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.
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.
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
}
Related
Suggestions are very useful, but sometimes they're annoying.
I want to hide suggestions when what I typed is a known word in the language or in the current document.
E.g.: Since I used the word elapsed in a document, every single else I typed after it selected elapsed. Very annoying. Since else is a known word, I want the suggestions disappear, so when I hit ENTER the final word is that what I typed. This is a case; there are a lot of cases.
Other editors hide suggestions on known words (e.g.: Kate).
Tuning "editor.quickSuggestionsDelay" doesn't help, because frequently I stop to think and suggestions will appear anyway.
"editor.acceptSuggestionOnEnter": false doesn't help too; I've tried it but I'm not productive using TAB instead of ENTER.
I also tried "editor.wordBasedSuggestions": false, but this is not what I want. It hides every known word, but I want to select known words if I didn't type one.
I would like an option like "editor.hideSuggestionsOnKnownWord": true, but I could not find nothing similar in vscode.
Is there an option or an extension to do that?
Currently, when I use ctrl+h with something highlighted, my find term is set equal to the highlighted text. Is there a way to stop that (and keep my find term the same as it was previously)?
Often I want to find-and-replace in VS Code, do something, highlight something, and then find-and-replace the same thing again. Is there a way to make it so that I don't have to retype my find term a second time?
I know there are some plugins that have this functionality; if you know of any that allow me to see both my find and replace terms at the same time, I would like to know.
Set this setting to false:
// Controls if we seed the search string in Find Widget from editor selection
"editor.find.seedSearchStringFromSelection": false,
Editor > Find: Seed Search String From Selection
Doing this will also affect your Find/Search in Files functionality.
Intellisense is not considering all characters and therefore is not showing all functions/vars/tags/.../ that are available. Let me give you two gif examples.
1st example, HTML, click me: <title> is suggested when the word title was typed, but it is not suggested when the words itle or <itle were typed.
In JS it is also not what I would expect.
2nd example, JS, click me: when the word timeout is typed, it suggests the function setTimeout. But there is another function settimeout, which actually is a snippet, so it is more valuable for me than the suggested one. settimeout even has a short description right next to it Set Timeout Function. Would be nice to search that description too.
It seems to be that VS Code is looking for words instead of all chars when suggesting functions/vars/tags/.../. I found 2 settings to play with, but they didn't change anything.
"editor.wordBasedSuggestions": false,
"editor.suggest.showWords": false
Is there a way to turn the suggestion feature the way I want to have it?
I updated the vscode to v1_43.
It's too bad to highlight the new syntax.
How to use v1_42 syntax highlighting in v1_43.
prev
new
This is semantic highlighting. Semantic highlights are based on the type of the values, for example globals can be colored differently than local variables.
To disable it, just set:
editor.semanticHighlighting.enabled: false
Try leaving it on however. Semantic highlighting provides useful information and once you get used to it, the old highlighting will instead look wrong
I got a VSCode JSLint extension and I got its settings pointing to an .eslintrc file where I have the following specified for indentation:
{
...
"indent" : [1, "tab"]
...
}
The problem is, it's still putting the squiggly green lines where I have some tabs and I can't tell where anything's going wrong with any settings.
I have evidence the rc file is actually working because I was successfully able to change it from single to double-quotes. However it appears to completely ignore the indentation setting inside my VSCode.
You could simply disable the use_spaces rule. It's separate from the indent rule you changed. A bit over an oversight from JSLint.
There were quite a few complains about that rule, even here on SO. Quite a few people (not only on SO) suggest switching to JSHint instead. Personally I've only used ESLint and therefore don't know much about the differences, and I'd suggest checking those for yourself anyway.