question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatically selecting auto completion suggestion despite not pressing enter or tab key

See original GitHub issue

Please 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.

image

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: image

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): image

clangd extension version: 0.1.18 Operating system: Manjaro XFCE

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sam-mccallcommented, Jul 12, 2022

Yeah, there are a few intersecting pieces of behavior here:

Because 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 get while ((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.

0reactions
HighCommander4commented, Jul 16, 2022

@HighCommander4 did you manage to reproduce the behavior in vscode?

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trap the enter key, but not when choosing the browser's ...
I track when the user presses the up, down, page-up and page-down keys to tell ... Enter, but not whilst they're in the...
Read more >
Allow Option to Not Autocomplete on Enter · Issue #4799 ...
My suggestion: Add an option to not auto-complete on enter (just tab). Also, it probably would be a good idea to allow sci_enter...
Read more >
Intellisence / Autocomplete - pressing enter creates a new line ...
When using Intellisence / Autocomplete I cannot use the 'enter' key to select an option anymore. Tab works, but enter now just creates...
Read more >
Auto-completion - Notepad++ User Manual
You accept the suggestion by typing the completion key (see “Automatic completion”, below), and the word is completed within your buffer as if...
Read more >
Excel Cells & Ranges - AutoComplete - BetterSolutions.com
You can accept the suggestion by pressing either the (Enter) or (Tab) keys. It is possible to also accept the suggestion by pressing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found