In Visual Studio Code, I get suggestions when I type in a Razor file. Pressing Spacebar accepts the suggestion. This is often not the word I wanted to type.
Example:
Pressing Spacebar changes "all" to "allow," which is not what I wanted.
At first, I thought these suggestions could be disabled by diabling quick suggestions for this language, aspnetcorerazor
.
So I tried adding this to my settings.json
file:
"[aspnetcorerazor]": {
"editor.quickSuggestions": {
"other": "off",
"comments": "off",
"strings": "off"
}
},
But that had no effect, even after restarting Visual Studio Code.
How can we disable these suggestions for Razor files?
In Visual Studio Code, I get suggestions when I type in a Razor file. Pressing Spacebar accepts the suggestion. This is often not the word I wanted to type.
Example:
Pressing Spacebar changes "all" to "allow," which is not what I wanted.
At first, I thought these suggestions could be disabled by diabling quick suggestions for this language, aspnetcorerazor
.
So I tried adding this to my settings.json
file:
"[aspnetcorerazor]": {
"editor.quickSuggestions": {
"other": "off",
"comments": "off",
"strings": "off"
}
},
But that had no effect, even after restarting Visual Studio Code.
How can we disable these suggestions for Razor files?
What worked for me was setting editor.wordBasedSuggestions
for both html, and aspnetcorerazor:
"[html]": {
"editor.wordBasedSuggestions": "off"
},
"[aspnetcorerazor]": {
"editor.wordBasedSuggestions": "off"
},
Try
"[razor]": {
"editor.quickSuggestions": {
"other": "off",
"comments": "off",
"strings": "off"
}
now no suggestions on my side:
On myside,it works even without restarting vs code: