-
Notifications
You must be signed in to change notification settings - Fork 184
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
[clangd] Auto complete feature is not so accurate for C/C++ struct type #2521
Comments
It looks like these snippets come from Sublime's builtin C++ package: https://github.com/sublimehq/Packages/tree/master/C%2B%2B/Snippets There are a few different options to disable them:
Note that LSP does also obey the following settings which would apply for snippets provided by a language server:
This should be possible if the CompletionItem provides a |
Thanks for your prompt reply.
|
Where do you get this expectation from? Do other editors(that implement the LSP spec) do that? The editor will insert/edit text based on what the language server tells it to, |
Yes, I used VSCode with clangd extension, the dot to arrow feature is implemented already, which is quite convenient. There is also a link "[clangd][vscode] Enable dot-to-arrow fixes in clangd completion." about this feature.
I copy and paste the Lsp logs after I type dot after the struct pointer as below. though I don't fully understand it.
I think the problem is that clangd didn't give the right code complete items as it did in VSCode like below. After I select one of the complete items, the dot will convert to arrow automatically in VSCode. |
Whether those completions are provided depends on client announcing support for clangd's custom Per previously referenced change, for VSCode they combine it with some custom completions handler to workaround VSCode filtering issue but for us I think it would work just fine without anything like that. The only problem is that currently we don't support extending arbitrary capabilities but only adding ones in |
Description
There are some extra unwanted completions (which are snippets) for a struct variable as below:
Dot operator after a structure pointer would not transform to arrow (->) operator automatically as in VS Code, and the completions are all unwanted snippets too.
Expected behavior
Environment
The text was updated successfully, but these errors were encountered: