Automatically selecting auto completion suggestion despite not pressing enter or tab key
See original GitHub issuePlease describe the problem. For hints on what information is helpful, see: https://clangd.llvm.org/troubleshooting.html
After todays update to version 0.1.18, it automatically selects the auto completion suggestion.
For example if i write while
and then when i open a curved bracket without clicking or selecting the while snippet suggestion, it automatically selects that snippet without my wish and finally it looks like this:
There are two brackets inside while loop, one is mine and other is snippet’s.
Same problem is also occuring in if
and also many other conditions/loops etc.
When I reverted back to older version, the problem disappeared.
Logs
Please attach the clangd log from the “Output” window if you can.
If possible, run with --log=verbose
- note that the logs will include the contents of open files!
I[00:44:13.619] --> textDocument/clangd.fileStatus
I[00:44:13.619] --> textDocument/clangd.fileStatus
I[00:44:13.621] --> workspace/semanticTokens/refresh(37)
I[00:44:13.621] --> textDocument/clangd.fileStatus
I[00:44:13.621] --> textDocument/clangd.fileStatus
I[00:44:13.621] --> textDocument/clangd.fileStatus
I[00:44:13.621] <-- reply(37)
System information
Clangd version (from the log, or clangd --version
):
clangd extension version: 0.1.18
Operating system: Manjaro XFCE
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Yeah, there are a few intersecting pieces of behavior here:
editor.acceptSuggestionsOnCommitCharacter
being on by default(
)(
and its matching)
) when we’d rather it only trigger the suggestions (e.g.wh(
=>while(^)
notwhile((^))
, this is https://github.com/microsoft/vscode/issues/42544Because it was broken for so long, we didn’t understand all the interactions, and the result is a broken mess: you type
whi(
, maybe with no intention of triggering completion at all, and getwhile ((condition)) { }
. While each individual piece is working as (someone) intended, the result best seen as a bug.The only piece we have control over is the set of commit characters, so we’ll try and find a sensible fix in those terms.
Yeah, you were right that the reason I wasn’t seeing the auto-activation was due to
editor.quickSuggestions.other: off
, and the commit behaviour due to being on an older vscode-clangd than 0.1.18.Having now installed 0.1.18 to see what it’s like, I agree that interaction between the
(
commit character and snippets is bad, and means that(
probably shouldn’t be a commit character until vscode fixes that somehow (or at least, not a commit character when snippets are enabled?)Some of the other commit characters seem fine, though, and some like
;
and.
in particular seem useful – perhaps we could consider bringing back a more restricted set?