zed/crates/languages/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
..
bash Recognize PKGBUILD as bash script (#10946) 2024-04-25 09:44:52 -04:00
c Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
cpp Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
css Add outlines for CSS (#8706) 2024-03-14 20:31:52 -04:00
erb chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
go Add the ability for extensions to provide language settings (#10296) 2024-04-08 19:17:12 -04:00
gomod File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
gowork File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
javascript Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
jsdoc Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
json Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
markdown Add the ability for extensions to provide language settings (#10296) 2024-04-08 19:17:12 -04:00
proto chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
python chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
regex Add regex syntax highlighting for JS and TS (#7851) 2024-03-18 09:49:01 -06:00
ruby Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
rust Add @operator, @lifetime and @punctuation.delimiters captures for Rust (#10885) 2024-04-25 14:20:20 -04:00
tsx Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
typescript Highlight reference types directive in TypeScript (#11039) 2024-04-29 11:38:53 +03:00
yaml Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
bash.rs Add basic bash and Python tasks (#10548) 2024-04-15 16:07:21 +03:00
c.rs Add ability to specify binary path/args for clangd (#10608) 2024-04-16 18:17:15 +02:00
css.rs Improve the ergonomics of creating local buffers (#10347) 2024-04-10 08:32:51 -06:00
elm.rs Add language_server_workspace_configuration to extension API (#10212) 2024-04-05 17:04:07 -04:00
go.rs Add ability to specify binary path/args for clangd (#10608) 2024-04-16 18:17:15 +02:00
json.rs Rework task modal (#10341) 2024-04-11 02:02:04 +03:00
lib.rs Register ESLint as an available language server (#11178) 2024-04-29 13:18:30 -04:00
python.rs Properly pass nested script arguments for tasks (#10776) 2024-04-19 16:24:35 +03:00
ruby.rs ruby: Check if solargraph exists in $PATH or is configured (#10835) 2024-04-22 10:44:05 +02:00
rust.rs Properly extract package name out of cargo pkgid (#10929) 2024-04-24 14:12:59 +03:00
tailwind.rs Add language_server_workspace_configuration to extension API (#10212) 2024-04-05 17:04:07 -04:00
typescript.rs typescript: Complete function calls with snippets (#11157) 2024-05-02 10:50:01 +02:00
yaml.rs Add language_server_workspace_configuration to extension API (#10212) 2024-04-05 17:04:07 -04:00