zed/crates/editor/src
Thorsten Ball c81230405f
typescript: Complete function calls with snippets (#11157)
This allows function call (i.e. snippet) completion with
`typescript-language-server`. So far that didn't work, because
`typescript-language-server` doesn't respond with `insertText` when
getting the completions, but only when then sending
`completionItem/resolve` requests. See:
https://github.com/hrsh7th/nvim-cmp/issues/646#issuecomment-992765479

What this PR does is to support text edits in the response to
`completionItem/resolve`, which means updating the completion item.

It then enables this feature by default for
`typescript-language-server`.


TODOs:

- [x] Make this work over collab
- [x] Test that this doesn't break existing language server support
- [x] Refactor duplicated code

Release Notes:

- Added support for function call completion when using
`typescript-language-server`. This will result in parameters being
added, which can then be changed and navigated with `<tab>`. For this to
work with `typescript-language-server`, the documentation for a given
completion item needs to be resolved, meaning that if one types very
quickly and accepts completion before `typescript-language-server` could
respond with the documentation, no full function completion is used.

Demo:


https://github.com/zed-industries/zed/assets/1185253/c23ebe12-5902-4b50-888c-d9b8cd32965d
2024-05-02 10:50:01 +02:00
..
display_map Allow to toggle git hunk diffs (#11080) 2024-05-01 22:47:36 +03:00
git Only keep one blame up-to-date (#11274) 2024-05-01 16:25:26 -06:00
scroll Allow to toggle git hunk diffs (#11080) 2024-05-01 22:47:36 +03:00
test Improve the ergonomics of creating local buffers (#10347) 2024-04-10 08:32:51 -06:00
actions.rs Allow to toggle git hunk diffs (#11080) 2024-05-01 22:47:36 +03:00
blame_entry_tooltip.rs Merge ElementContext into WindowContext (#10979) 2024-04-25 12:54:39 +02:00
blink_manager.rs Remove 2 suffix for editor 2024-01-03 10:58:57 -08:00
debounced_delay.rs Add debounce for re-querying completion documentation 2024-01-31 09:50:26 -05:00
display_map.rs Improve the ergonomics of creating local buffers (#10347) 2024-04-10 08:32:51 -06:00
editor_settings.rs Scrollbar markers for cursors (#10816) 2024-04-27 02:26:42 +03:00
editor_tests.rs Allow to toggle git hunk diffs (#11080) 2024-05-01 22:47:36 +03:00
editor.rs typescript: Complete function calls with snippets (#11157) 2024-05-02 10:50:01 +02:00
element.rs Allow to toggle git hunk diffs (#11080) 2024-05-01 22:47:36 +03:00
git.rs Allow to toggle git hunk diffs (#11080) 2024-05-01 22:47:36 +03:00
highlight_matching_bracket.rs Compute scrollbar markers asynchronously (#10080) 2024-04-03 12:21:17 +02:00
hover_links.rs Fix cmd+click find all references fallback not working in Vim mode (#10684) 2024-04-25 09:07:14 -06:00
hover_popover.rs Remove if-not-else patterns (#10402) 2024-04-11 03:48:06 -04:00
hunk_diff.rs Allow to toggle git hunk diffs (#11080) 2024-05-01 22:47:36 +03:00
inlay_hint_cache.rs Add a setting for custom associations between languages and files (#9290) 2024-03-13 10:23:30 -07:00
inline_completion_provider.rs Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
items.rs support vim replace command with range (#10709) 2024-04-29 18:49:30 -06:00
mouse_context_menu.rs Add "Open in Terminal" context menu entries for project panel, editor and tab context menus (#10741) 2024-04-19 01:43:46 +03:00
movement.rs Adjust left movement when soft_wrap mode is used (#10464) 2024-04-12 10:36:31 -06:00
persistence.rs wip 2023-01-25 11:32:19 -08:00
rust_analyzer_ext.rs open new buffer (#11203) 2024-04-30 16:09:43 -06:00
scroll.rs Allow to toggle git hunk diffs (#11080) 2024-05-01 22:47:36 +03:00
selections_collection.rs Enable clippy::clone_on_copy (#8728) 2024-03-02 17:37:48 -05:00
test.rs Allow to toggle git hunk diffs (#11080) 2024-05-01 22:47:36 +03:00