So when I type in an emmet abbreviation like div.result which should then expand to <div className='result'></div>. However, with Intellisense, VS Code detects that I have a filename called MovieResults, and suggests it.
I hit esc because then otherwise, my emmet abbreviation turns into <div className='MovieResult'></div>.
The suggestion goes away, but from there, I don't know of any other way to expand the abbreviation, other than setting "emmet.triggerExpansionOnTab": true.
Any ideas on a solution to this? It's just bugging me that I'm trying to name the className as results, but Emmet isn't offering me an autocompletion for it.
Here are some images of what I'm talking about:
In my case I had changed to:
"emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly",
changing back to the default fixed the issue:
"emmet.showExpandedAbbreviation": "always"
Also this will help:
"emmet.showSuggestionsAsSnippets": true,
"editor.snippetSuggestions": "top",
Related
I find this distracting:
I found the "editor.guides.highlightActiveBracketPair" setting and disabled it the settings (Ctrl+,), but nothing changed. I restarted the editor, but nothing changed. I checked ~/.config/Code/User/settings.json, and saw that it was there:
"editor.guides.highlightActiveBracketPair": false,
But still no change. I even added it again in a Python-specific block, because I learned how to do that when I went on a similar journey trying to change default indent for YAML files:
"[python]": {
"editor.guides.highlightActiveBracketPair": false
}
But still no change.
The answer is:
"editor.matchBrackets": "never",
The setting is listed in the reference:
// Highlight matching brackets.
"editor.matchBrackets": "always",
However, the reference doesn't list the possible options. I correctly guessed "never", but afterwards, I searched for "brackets" in the app settings (Ctrl+,) and found the setting with a drop-down box with all three possible values:
always
near
never
Is there a way to stop Visual Studio Code to autocomplete words, or to stop inserting snippets when working on a "PlainText" document?
I love VSC, but I use a lot of plain-text to take notes and so on. I don't want VSC to turn a 'sentence' like "I was" into:
I <i class="fas fa-car-wash "></i>
just because I pressed [Enter] after the word 'was'.
I can kill the autocomplete in total, but I like it in code files.
I just don't want it when the type is set to plaintext.
Look at language-specific settings. See https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings
"[plaintext]": {
"editor.suggest.showSnippets": false,
"editor.suggest.showWords": false,
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.acceptSuggestionOnEnter": "off"
},
Try setting "editor.wordBasedSuggestions": false.
You can also play around with what VSCode can suggest in Settings:
Ctrl + Shift + P => Preferences: Open Settings (UI) => Text Editor => Suggestions
#cryothic: had the very same problem as you asked for.
I was rather successfull with this somewhat simpler addition to settings.json;
no more annoying test suggestions since.
"[plaintext]": {
"editor.quickSuggestions": false,
Emmet abbreviations are routinely getting in my way when writing jsx/tsx code, popping up and taking precedence over methods or other completions I actually want. For instance, in this screenshot the Emmet abbreviation is getting in the way of auto-completing the replace method on a string:
This happens surprisingly frequently.
I don't currently use Emmet. Is there any way to turn them off entirely, or at least in .js, .jsx, .ts, and .tsx files? I've kicked around the settings a fair bit and while there are lots of Emmet-related options, I can't find a simple off switch! :-)
You can turn emmet off in suggestions completely with:
{
"emmet.showExpandedAbbreviation": "never"
}
You can turn emmet off by language with:
"emmet.excludeLanguages": [
"typescriptreact", "javascriptreact"
],
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
}
I cannot figure out the option to turn off the new "feature" where the VS Code HTML mode editor types stuff for you in the following scenario:
I type <b> and when I hit that last > it then types </b> which I then have to delete and move to where I want it.
How do I keep VS Code from typing stuff for me in this case? I have these two options set like this:
"editor.quickSuggestions": false,
"editor.autoClosingBrackets": false,
Sort of the opposite of this question: VSCode not auto completing HTML
I found it:
// Enable/disable autoclosing of HTML tags.
"html.autoClosingTags": true,
This new feature shipped with autoClosingTags set to true by default, which was, unfortunately, a disruptive change if you were used to being able to type without random stuff being inserted into your document as a side effect.
Setting autoClosingTags to false restores the original behavior.
"html.autoClosingTags": true,
"html.autoClosingTags": true,
Does not work for me .. maybe misleading or bug
I do a workaround to change the type of the file down the editor to handlebars or another language because it was very frustrating for me that the editor insists to add something I understand I do not need like closing tag while the closing tag should be at footer file.