Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliSense autocomplete "on dot" choosing incorrect symbol

I'm editing a stand-alone JavaScript file in VSCode 1.19.2. I do not have a project set up, and no jsconfig.json to control it.

I enter the following code into an empty editor:

var scene = new THREE

Intellisense starts to kick in and gives an auto-complete list.

enter image description here

When I press "." (expecting my code to become THREE.), IntelliSense takes this as a sign that it gave me the right answer, and changes my code to:

var scene = new HTMLHRElement.

The full string "THREE" wasn't even in the list, but IntelliSense seems to be using some kooky regular expression to predict what the user actually tried to type--the letters are all there in the applied symbol, but they're all split up and in different cases.

For me, this is counter-intuitive (not to mention frustrating beyond words, because I type this string a lot), but everything I've found so far is people asking for this feature. So, I'm looking for a work-around for me.

Is there any way to turn off "complete on dot," or maybe a similar setting to force IntelliSense autocomplete only on tab? Also feel free to correct my terminology, in case that was preventing me from finding the correct answer.

like image 743
TheJim01 Avatar asked Jan 15 '18 16:01

TheJim01


1 Answers

JavaScript and TypeScript treat . as accepting the current suggestion by default. You can disable this by setting:

"editor.acceptSuggestionOnCommitCharacter": false

or, if you only want them disabled in js:

"[javascript]": {
  "editor.acceptSuggestionOnCommitCharacter": false
}
like image 93
Matt Bierner Avatar answered Oct 20 '22 18:10

Matt Bierner