-
Notifications
You must be signed in to change notification settings - Fork 118
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
Please add an option to disable auto-completion like any other plugins #588
Comments
To clarify, are you looking for an option to disable code completion altogether, or an option to disable the insertion of |
I am looking for the former. Of course, the root of the issue is the latter, but it's bundled in clangd itself. I have seen the other issue at llvm/llvm-project#63565, and I believe it would take years to finally land into, for example, Debian stable APT repositories. On the other hand, vscode extensions can be much more actively updated. |
Thanks for clarifying. (Not sure if it's relevant in your use case, but LLVM does have a set of APT packages (including a clangd package) that are updated daily at https://apt.llvm.org.) Since you wrote earlier:
could you give an example of another plugin (especially an LSP client plugin) which has this kind of option? |
Thanks for the information. I can try it.
The Microsfot C/C++ extension has an option to disable C/C++ auto-completion: The 'C/C++ Clang Command Adapter' extension also has such an option; however it parses clang output directly, instead of using a language server: |
Thanks. I checked the implementation of this option in vscode-cpptools (the server is proprietary but the client's source code is available). It looks like it's implemented on the server side; the value of the checkbox is just propagated to the server in the initialization options. (And I'm guessing it has the effect of the server sending an empty response to completion requests?) So, if vscode-clangd used a simlar implementation, you would still need an updated server for the option to work. I think it would be better to have a way of implementing the option entirely on the client side, but it's not clear to me how to accomplish this with the vscode-languageclient API. (I looked at the vscode-clang plugin as well. There, the option is implemented entirely on the client side, but since this plugin does not use the LSP, it uses a different API surface than LSP plugins, so I don't think the way it does things is applicable to vscode-clangd.) |
I know almost nothing about LSP; am I correct to say that auto-completion is fully controlled by the server (and not the client), and if the server sends a completion response, there is nothing we can do on the client side? |
Actually, I realized this can be done relatively easily using middleware. |
I created this file: #include <new>
using namespace std;
void
test()
{
}
#include <new>
using namespace std;
void
test()
{
return_temporary_buffer( )
}
It looks like this was because I set |
Proposed patch: #591 |
Thanks! |
This follows #390 (comment) by @HighCommander4, but details about the current behavior are #390 (comment) by @MK-Alias (and thanks for the screenshots!).
I have a habit of typing the immediate
(
after the name of a function. Because vscode-clangd auto-completes it, I always have to remember to backspace my own parenthesis. This behavior is inconsistent with any other editor or IDE, and I am too stupid to get rid of my habit, so please provide an option to disable it. Thanks in advance.The text was updated successfully, but these errors were encountered: