ZIm/crates/project/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
..
connection_manager.rs WIP: remoting (#10085) 2024-04-11 15:36:35 -06:00
debounced_delay.rs Add debounce for re-querying completion documentation 2024-01-31 09:50:26 -05:00
lsp_command.rs typescript: Complete function calls with snippets (#11157) 2024-05-02 10:50:01 +02:00
lsp_ext_command.rs text: Wrap BufferId into a newtype 2024-01-29 20:00:47 +01:00
prettier_support.rs Improve handling of prettier errors on format (#10156) 2024-04-04 11:41:55 +02:00
project.rs typescript: Complete function calls with snippets (#11157) 2024-05-02 10:50:01 +02:00
project_settings.rs Allow to toggle git hunk diffs (#11080) 2024-05-01 22:47:36 +03:00
project_tests.rs open new buffer (#11203) 2024-04-30 16:09:43 -06:00
search.rs Support newline and tab literals in regex search-and-replace operations (#9609) 2024-03-25 12:21:04 +01:00
search_history.rs project search: Persist search history across session (#9932) 2024-04-02 11:13:18 +02:00
task_inventory.rs Filter out other languages' tasks from the task modal (#10839) 2024-04-22 12:36:26 +03:00
terminals.rs Properly pass nested script arguments for tasks (#10776) 2024-04-19 16:24:35 +03:00