Open HayDegha0917 opened 3 years ago
To some degree this is already possible. The spell checker does not understand the parts of the code, but it does allow controlling which sections of a file get check using a regular expression.
For some languages a RegExp is already defined.
Example:
{
"languageSettings": [
{
"languageId": "javascript",
"includeRegExpList": [
"CStyleComment",
"string"
]
}
]
}
Thanks for the tip. It helps a bit, though the pre-defined regular expressions are not foolproof. For example, the "string" pattern does not omit variables in template strings. And, in some cases, declared variables are still spell checked. Using a language tokenizer would really work better.
I would like to filter the types of objects (variables, constants, function names, etc.) that the spell checker checks because variable and function names are often abbreviated. The way it works now, the spell checker complains about all of those, creating a huge list of flagged objects.
This obscures those cases where spell checking really matters, like messages and comments.
The ability to filter by object type would make the extension much more useful. As it is now, I will most likely turn it off because the cost of combing through unimportant messages outweighs the benefit of catching spelling errors in stuff that affects usability.