ZIm/crates
Kirill Bulatov 5bde053b0d
Avoid panics when normalizing completion label with invalid ranges (#23712)
Dev builds show panics related to completion label normalization

<details>
<summary>Panic</summary>

```
index out of bounds: the len is 103 but the index is 103
zed::reliability::init_panic_hook::{{closure}}::h78130eff43c84f6f+110375521
std::panicking::rust_panic_with_hook::hfe205f6954b2c97b+87457752
std::panicking::begin_panic_handler::{{closure}}::h6cb44b3a50f28c44+87456967
std::sys::backtrace::__rust_end_short_backtrace::hf1c1f2a92799bb0e+87449337
rust_begin_unwind+87456084
core::panicking::panic_fmt::h3d8fc78294164da7+7033011
core::panicking::panic_bounds_check::h9397cb495d89a72d+7033511
project::lsp_store::ensure_uniform_list_compatible_label::haf80316ce11edd67+72663592
project::lsp_store::populate_labels_for_completions::{{closure}}::hc93c3c540ef7d2d6+72642960
project::lsp_store::LspStore::completions::{{closure}}::{{closure}}::hb4b5432e24432ca8+72336627
async_task::raw::RawTask<F,T,S,M>::run::hf444c3dc07dd583b+68504803
<gpui::platform::linux::wayland::client::WaylandClient as gpui::platform::linux::platform::LinuxClient>::run::hbf5a316eb781a10d+50646579
gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::run::hc85518d4552fc4cd+50496669
gpui::app::App::run::hca4e2eaf984ca6f6+109905269
zed::main::h849467ac1a6d32c9+110413414
std::sys::backtrace::__rust_begin_short_backtrace::h81b5ee155a7cf505+110835475
std::rt::lang_start::{{closure}}::h48a83f884cfb6865+110834761
std::rt::lang_start_internal::h5e7c81cecd7f0954+87382485
main+110425932
__libc_start_call_main+22789462491720
__libc_start_main_alias_1+22789462491915
_start+10436606
```
</details>

This can only happen when either `label.runs` or `label.filter_range`
has a range that's larger than the label text, which is an error.
Instead of panicking, log such errors and fall back to last index (which
is not really helpful, but still).

Release Notes:

- N/A
2025-01-27 14:18:39 +00:00
..
activity_indicator Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
anthropic Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
assets Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
assistant Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
assistant2 Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
assistant_context_editor Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
assistant_settings Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
assistant_slash_command Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
assistant_slash_commands Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
assistant_tool Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
assistant_tools Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
audio Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
auto_update Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
auto_update_ui Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
breadcrumbs Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
call Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
channel Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
cli Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
client Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
clock chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
collab Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
collab_ui Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
collections chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
command_palette Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
command_palette_hooks Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
context_server Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
context_server_settings Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
copilot Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
db Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
diagnostics Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
docs_preprocessor Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
editor Fix completions menu scroll when y_flipped and edit prediction arrives (#23580) 2025-01-27 00:36:21 -07:00
evals Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
extension Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
extension_api chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
extension_cli chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
extension_host Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
extensions_ui Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
feature_flags Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
feedback Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
file_finder Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
file_icons Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
fireworks chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
fs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
fsevent chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
fuzzy chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
git Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
git_hosting_providers Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
git_ui Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
go_to_line Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
google_ai chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
gpui gpui: Support windows dark mode title bar (#23700) 2025-01-27 20:07:28 +08:00
gpui_macros Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
html_to_markdown Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
http_client chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
image_viewer Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
indexed_docs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
inline_completion Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
inline_completion_button Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
install_cli Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
journal Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
language Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
language_extension Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
language_model Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
language_model_selector Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
language_models Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
language_selector Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
language_tools Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
languages Add auto-completion support for snippet files (#23698) 2025-01-27 12:32:22 +01:00
livekit_client Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
livekit_client_macos Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
livekit_server chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
lmstudio Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
lsp Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
markdown Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
markdown_preview Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
media chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
menu chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
multi_buffer Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
node_runtime chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
notifications Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
ollama Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
open_ai Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
outline Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
outline_panel Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
paths Add auto-completion support for snippet files (#23698) 2025-01-27 12:32:22 +01:00
picker Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
prettier Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
project Avoid panics when normalizing completion label with invalid ranges (#23712) 2025-01-27 14:18:39 +00:00
project_panel Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
project_symbols Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
prompt_library Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
proto project: Revert project tree impl (again) (#23572) 2025-01-23 16:10:38 -05:00
recent_projects Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
refineable project: Revert project tree impl (again) (#23572) 2025-01-23 16:10:38 -05:00
release_channel Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
remote Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
remote_server Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
repl Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
reqwest_client Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
rich_text Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
rope Rework go to line infrastructure (#23654) 2025-01-25 19:24:19 +00:00
rpc Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
search Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
semantic_index Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
semantic_version chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
session Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
settings Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
settings_ui Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
snippet Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
snippet_provider Add auto-completion support for snippet files (#23698) 2025-01-27 12:32:22 +01:00
snippets_ui Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
sqlez Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
sqlez_macros chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
story Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
storybook Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
streaming_diff chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
sum_tree Rework diff rendering to allow putting the cursor into deleted text, soft-wrapping and scrolling deleted text correctly (#22994) 2025-01-24 14:18:22 -07:00
supermaven Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
supermaven_api Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
tab_switcher Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
task Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
tasks_ui Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
telemetry chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
telemetry_events chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
terminal Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
terminal_view Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
text Rework go to line infrastructure (#23654) 2025-01-25 19:24:19 +00:00
theme Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
theme_extension Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
theme_importer Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
theme_selector Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
time_format chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
title_bar Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
toolchain_selector Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
ui Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
ui_input Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
ui_macros Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
util Canonicalize paths when running tests (#23655) 2025-01-26 14:56:07 +08:00
vcs_menu Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
vim Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
vim_mode_setting Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
welcome Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
workspace Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
worktree Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
zed Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
zed_actions Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
zed_predict_tos Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
zeta Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00