Andy Levy shows how to create a custom dictionary for a programming language in Visual Studio Code:
But as you can see from the marketplace page there, by default this plugin doesn’t know PowerShell. In my user settings file
settings.json
, I added PowerShell to thecSpell.enabledLanguageIds
section so it’s always recognized:
1234567891011121314151617181920"cSpell.enabledLanguageIds"
: [
"c"
,
"cpp"
,
"csharp"
,
"go"
,
"javascript"
,
"javascriptreact"
,
"json"
,
"latex"
,
"markdown"
,
"php"
,
"plaintext"
,
"powershell"
,
"python"
,
"text"
,
"typescript"
,
"typescriptreact"
,
"yml"
,
"powershell"
],
And with that, VSCode was giving me green squiggles under lots of words – both misspelled and not. Code Spellchecker doesn’t understand PowerShell in its default setup, it doesn’t have a dictionary for it. Just to get things started, I added a
cSpell.userWords
section to mysettings.json
and the squiggles started disappearing.
It’s an interesting post, so read the whole thing.