ZIm/crates/editor/src
Kirill Bulatov 8a7a78fafb
Avoid modifying the LSP message before resolving it (#26347)
Closes https://github.com/zed-industries/zed/issues/21277

To the left is current Zed, right is the improved version.
3rd message, from Zed, to resolve the item, does not have `textEdit` on
the right side, and has one on the left.
Seems to not influence the end result though, but at least Zed behaves
more appropriate now.

<img width="1727" alt="image"
src="https://github.com/user-attachments/assets/ca1236fd-9ce2-41ba-88fe-1f3178cdcbde"
/>


Instead of modifying the original LSP completion item, store completion
list defaults and apply them when the item is requested (except `data`
defaults, needed for resolve).

Now, the only place that can modify the completion items is this method,
and Python impl seems to be the one doing it:


ca9c3af56f/crates/languages/src/python.rs (L182-L204)

Seems ok to leave untouched for now.

Release Notes:

- Fixed LSP completion items modified before resolve request
2025-03-10 00:12:53 +02:00
..
display_map vim: Add registers view (#25945) 2025-03-04 21:59:19 -07:00
git Fix panic when expanding a deletion hunk with blame open (#26130) 2025-03-05 13:07:36 -05:00
scroll Rework edit prediction preview mode (#24700) 2025-02-11 23:14:12 +00:00
test Test folded buffers navigation (#26286) 2025-03-07 16:19:12 +00:00
actions.rs Fixes to excerpt movement actions and bindings + add multibuffer and singleton_buffer key contexts (#26264) 2025-03-08 00:58:47 +00:00
blink_manager.rs editor: Remove some blank lines (#26249) 2025-03-06 22:58:46 +00:00
clangd_ext.rs Worktree paths in git panel, take 2 (#26047) 2025-03-06 22:55:28 +00:00
code_context_menus.rs Avoid modifying the LSP message before resolving it (#26347) 2025-03-10 00:12:53 +02:00
commit_tooltip.rs Fix UI font size changes not applying (#25307) 2025-02-21 06:24:02 -03:00
display_map.rs vim: Add registers view (#25945) 2025-03-04 21:59:19 -07:00
editor.rs Avoid modifying the LSP message before resolving it (#26347) 2025-03-10 00:12:53 +02:00
editor_settings.rs Rust 1.85 (#25272) 2025-02-28 18:33:35 +01:00
editor_settings_controls.rs Fix UI font size changes not applying (#25307) 2025-02-21 06:24:02 -03:00
editor_tests.rs Avoid modifying the LSP message before resolving it (#26347) 2025-03-10 00:12:53 +02:00
element.rs git: Refine diff hunk controls visuals (#26317) 2025-03-08 01:00:47 -03:00
git.rs Project Diff 2 (#23891) 2025-02-03 13:18:50 -07:00
highlight_matching_bracket.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
hover_links.rs editor: Fix cmd + click on a URL not working sometimes (#26128) 2025-03-05 20:58:18 +05:30
hover_popover.rs Worktree paths in git panel, take 2 (#26047) 2025-03-06 22:55:28 +00:00
indent_guides.rs cx.background_executor().spawn(...) -> cx.background_spawn(...) (#25103) 2025-02-18 20:30:33 +00:00
inlay_hint_cache.rs Ensure inlay hint toggling with modifiers happens fast (#25852) 2025-03-01 08:15:57 +00:00
inline_completion_tests.rs Require alt-tab for AcceptEditPrediction when tab inserting whitespace is desired (#24705) 2025-02-12 01:14:09 +00:00
items.rs Worktree paths in git panel, take 2 (#26047) 2025-03-06 22:55:28 +00:00
jsx_tag_auto_close.rs Add support for auto-closing of JSX tags (#25681) 2025-03-06 08:36:10 -06:00
linked_editing_ranges.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
lsp_ext.rs project: Fine-grained language server management (#24038) 2025-02-14 15:41:49 +01:00
mouse_context_menu.rs editor: Disable "Open in Terminal" when it's not possible (#25059) 2025-02-18 04:07:04 -03:00
movement.rs Fixes to excerpt movement actions and bindings + add multibuffer and singleton_buffer key contexts (#26264) 2025-03-08 00:58:47 +00:00
persistence.rs Do not fail hard on selection persistence if the editor is removed (#25120) 2025-02-18 22:52:23 +00:00
proposed_changes_editor.rs Optimistically update hunk states when staging and unstaging hunks (#25687) 2025-02-28 20:55:29 +00:00
rust_analyzer_ext.rs lsp: Add support for clangd's inactiveRegions extension (#26146) 2025-03-06 21:30:05 +00:00
scroll.rs edit prediction: Refine the stealth mode (#25599) 2025-02-26 12:50:11 -03:00
selections_collection.rs Rust 1.85 (#25272) 2025-02-28 18:33:35 +01:00
signature_help.rs Add user-visible output for remote operations (#25849) 2025-03-03 09:20:15 +00:00
tasks.rs Improve Zed tasks' ZED_WORKTREE_ROOT fallbacks (#25605) 2025-02-26 22:30:31 +02:00
test.rs windows: Fix tests on Windows (#22616) 2025-02-05 14:30:09 +00:00