clangd / vscode-clangd

Visual Studio Code extension for clangd
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
MIT License
592 stars 97 forks source link

Can we have options to let autocompletion only complete the function name (without parenthesis and parameter) #627

Closed zyd2001 closed 2 months ago

zyd2001 commented 2 months ago

Most code completion plugins have the option to disable autocompletion adding parenthesis and I'm quite used to that behavior. However, there is no such option with vscode-clangd. I'm not sure whether it is a clangd server issue, but with my experience with LSP interface in neovim, disabling the LSP capabilities' textDocument.completion.completionItem.snippetSupport can achieve this.

HighCommander4 commented 2 months ago

vscode-clangd doesn't control the value of the snippetSupport capability, that's set by the vscode-languageclient plugin (which is shared by all languages), and it looks like that harcodes it to true.

However, clangd does have a server-side setting to disable argument placeholders, by passing --function-arg-placeholders=0 as a command-line argument to clangd. (In vscode, this can be specified with the "clangd.arguments" setting).

Parentheses are still inserted with --function-arg-placeholders=0. There is an issue on file about adding a more flexible setting which can also control insertion of parentheses: https://github.com/llvm/llvm-project/issues/63565.

HighCommander4 commented 2 months ago

Duplicate of https://github.com/llvm/llvm-project/issues/63565