-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CompletionItem missing InsertTextMode #2577
Comments
We can support I'm assuming most clients would want |
For LSP4E, AdjustIndentation would be fine, it's jut the case of "unset" that is not guaranteed. |
Maybe something @JessicaJHee can look at in the future. |
I'm interested in working on this! |
As an example, for VS Code, I see : client completion item capabilities sent in initialize "insertTextModeSupport": {
"valueSet": [
1,
2
]
}, client completion capabilities sent in initialize "insertTextMode": 2 If the client sets these in initialize, then the LS won't add the entry for ( |
Isn't it a bug? The specification doesn't mention that a handshake of capabilities is enough to determine the strategythat client should use, which can even be different from one completion list/item to another. The expectation is really that the intsertTextMode is made explicit on every response. |
The fix doesn't work with LSP4E. The insertTextMode is not set on the completionList nor the completionItem. |
There's no need to make If I look at https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionClientCapabilities , it states :
So if the client declares this, there's no need to also set it for completion items. |
LSP4E doesn't deine the
IMO, it's always better to be as explicit as possible, setting the insertTextMode on completion is much more universal, more backward-compatible and less error-prone. |
If lsp4e doesn't define the default |
My bad, I double checked and I do see that AdjustIndent is set on CompletionItems. So from LS perspective, I guess everything is correct. |
and I confirm eclipseide-jdtls is happy with this change. |
Since 3.16, InsertTextMode is supposed to be added to completion item in order to hint the client about whether to adjust indentation or not. This information is not provided by JDT-LS which makes client use the default behavior (which was not clearly specified before 3.16, so clients may handle it different)
The text was updated successfully, but these errors were encountered: