Vscode-cpptools: C++ namespace suggestion triggers on C label

Created on 13 Mar 2017  路  8Comments  路  Source: microsoft/vscode-cpptools

  • Cpptools version: 0.10.3
  • VSCode version: 1.10.2
  • OS Version: MacOS 10.12.3

When typing a label in C, Intellisense adds a suggestion for C++ class members. I believe the suggestion should only appear on the second consecutive colon.

screen shot 2017-03-12 at 6 46 15 pm

screen shot 2017-03-12 at 6 46 38 pm

Triggering on the first/any colon is a pain because by the time I hit enter for my label, that's a long enough window of time for the Intellisense suggestion to appear, causing a snippet instead of a new line.

(I'm learning C, and not familiar with C++; Sorry if this PR is confusing/wrong)

Language Service bug

All 8 comments

The autocomplete on ":" is a bug. It looks like it only repros if your computer is slow enough.

Also, the autocomplete commitment on Enter (and ;) is very annoying. In our next update, we're removing that by default for C/C++. You can add this to your settings to manually remove it:
"[cpp]": {
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.acceptSuggestionOnEnter": false
},
"[c]": {
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.acceptSuggestionOnEnter": false
}

Actually, we're still deciding if we want to add this setting by default...seems like we need more feedback from what users think. Visual Studio behaves this way when no result is selected in the autocomplete list, but VS Code always selects an item.

We're doing a little more testing of this on our side to try to tune the behavior better. In the meantime, you can also try toggling this setting in your settings.json file if you don't want to disable committing real suggestions with the Enter key:

"editor.quickSuggestions": false

It looks like it only repros if your computer is slow enough

_Did msft just call my computer slow?_ 馃槥

FWIW, I'm using a MBA that otherwise doesn't feel slow. We haven't quantified slow, but it doesn't feel like reproduction is performance related (the suggestion overlay appears quickly, ~300ms. Though, that is a long time to determine _whether it should appear_). Let me know if there's anything I can do to help with reproduction or otherwise improve the PR.

We have a fix to be released soon. We could only get the bug to repro via breaking in the debugger to slow down the execution of our auto completion code, which is why we guessed it required a slow enough computer to repro.

Did msft just call my computer slow? 馃槥

Sorry, @wgj. It was poor wording. We found an artificial time barrier someone left in the auto-complete code because of a misunderstanding of the VS Code protocol. The barrier was around 250ms and I suspect that your machine was just barely missing that mark.

No worries. I thought it was really funny, which didn't come across in text. Thanks for the quick response time.

This should be fixed in the latest version of the extension. Please let us know if you continue to see this issue.

Was this page helpful?
0 / 5 - 0 ratings