You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using ccls with vim/vim-lsp by default we get non sensible autocompletion behavior compared to clangd.
Here is an example of ccls completion with a minimal setup:
As you can see the type of the member is also inserted into the buffer along with the name.
After lots of digging around I found out this is a side effect of the completion.detailedLabel
option, that as stated by the wiki does this:
When this option is enabled, label and detailed are re-purposed:
label: detailed function signature, e.g. foo(int a, int b) -> bool
detailed: the name of the parent context, e.g. in S s; s.<complete>, the parent context is S.
interface CompletionItem {
/**
* The label of this completion item. By default
* also the text that is inserted when selecting
* this completion.
*/
label: string;
...
/**
* A human-readable string with additional information
* about this item, like type or symbol information.
*/
detail?: string;
So this option, despite having some useful usage somewhere, I think that it should be disabled by default to avoid confusion with perfectly compliant lsp configurations.
After disabling this option I noticed another minor (cosmetic) issue bellow:
The default pattern in the detail value seems kinda verbose for no reason, for example:
The completion field is shown both in the label value (as it should) and in the detail value (excessive).
As you can see the type of the member is also inserted into the buffer along with the name.
The root cause is that the language client doesn't support CompletionItem.textEdit. ccls really requires it, otherwise the experience may be really bad. And I don't bother add compatibility code as insertText should really be deprecated.
So this option, despite having some useful usage somewhere, I think that it should be disabled by default to avoid confusion with perfectly compliant lsp configurations.
It may confuse some users but others actually think the alternative view is appealing and makes better use of the space. See jacobdufault/cquery#391 for the rationale.
The default pattern in the detail value seems kinda verbose for no reason, for example:
That is true, but the result doesn't look bad if detail is not always available, but instead shown as a tooltip when you select the completion item.
Using ccls with vim/vim-lsp by default we get non sensible autocompletion behavior compared to clangd.
Here is an example of ccls completion with a minimal setup:
As you can see the type of the member is also inserted into the buffer along with the name.
After lots of digging around I found out this is a side effect of the
completion.detailedLabel
option, that as stated by the wiki does this:
That though, is not compliant to the lsp specification as we can see on the official page and protocol interface snippets:
https://microsoft.github.io/language-server-protocol/specification
So this option, despite having some useful usage somewhere, I think that it should be disabled by default to avoid confusion with perfectly compliant lsp configurations.
After disabling this option I noticed another minor (cosmetic) issue bellow:
The default pattern in the detail value seems kinda verbose for no reason, for example:
The completion field is shown both in the
label
value (as it should) and in thedetail
value (excessive).The same output from clangd for reference:
Link to the code that is relevant for the above:
ccls/src/messages/textDocument_completion.cc
Line 395 in cbe875d
The text was updated successfully, but these errors were encountered: