Closed rchl closed 3 years ago
It's same behavior as typescript-language-features https://github.com/microsoft/vscode/blob/main/extensions/typescript-language-features/src/languageFeatures/completions.ts#L223, because SymbolDisplayPart
only exists with CompletionDetailsResponse
.
From LSP specfication:
This is done using the
completionItem#resolveSupport
client capability which lists all properties that can be filled in during a ‘completionItem/resolve’ request
you can add textEdit
field to completionItem#resolveSupport
client capability and avoid insertText
which is deprecated.
It's same behavior as typescript-language-features https://github.com/microsoft/vscode/blob/main/extensions/typescript-language-features/src/languageFeatures/completions.ts#L223, because
SymbolDisplayPart
only exists withCompletionDetailsResponse
.
Yes, I understand it's mostly the same code that VSCode uses but I'm talking from the perspective of the LSP spec which VScode doesn't have to follow since they made their implementation not use LSP in the first place.
From LSP specfication:
This is done using the
completionItem#resolveSupport
client capability which lists all properties that can be filled in during a ‘completionItem/resolve’ requestyou can add
textEdit
field tocompletionItem#resolveSupport
client capability and avoidinsertText
which is deprecated.
Hmm, now that I'm re-reading my quoted sentence, I guess it doesn't disallow having insertText
(or textEdit
) in resolveSupport
. It just gives example on what would normally not be in resolveSupport
, but can be.
It's not very clear, I would say.
Yes, it says usually, not disallow.
I've been investigating the code related to the
javascript.suggest.completeFunctionCalls
setting and noticed that it updates theinsertText
property of the completion from thecompletionItem/resolve
request.Here is the relevant code: https://github.com/neoclide/coc-tsserver/blob/66ae279b1a3441ad5ca77d47934f99f039cd1e0b/src/server/features/completionItemProvider.ts#L376-L391
The LSP spec has this note regarding the
completionItem/resolve
handling:https://microsoft.github.io/language-server-protocol/specification#textDocument_completion
I'm just wondering what is your take on this because I was looking into implementing this within
typescript-language-server
but according to the spec this shouldn't work (and it likely won't in ST, for example).