-
Is it possible to configure the spell checker to ignore capitalised words? This would be words of any length that consist of all capital letters and which are prefixed and suffixed with either a whitespace character or other "separator" character (e.g. dash/hypen, comma, period etc.) One common use case for this is aliases in T-SQL text, such as: SELECT PA.AccountNumber, PAI.ProductCode, PAI.Quantity, P.Description
FROM dbo.ProductAccounts AS PA
INNER JOIN dbo.ProductAccountItems PAI on PA.Id = PAI.AccountId
INNER JOIN dbo.Products P ON P.Id = PAI.ProductCodeId Currently, all of the aliases used in the above T-SQL script (P, PA, PAI) are highlighted as spelling errors. I know I can add each of these to a personal or workspace dictionary but that is very cumbersome to do for each and every possible capitalised word that could be used across many files. Whilst SQL aliases are a common use case, many other use cases also exist such as in general text (i.e. acronyms, abbreviations etc.) Ideally, there would be an option that I can enable that tells the spell checker to globally ignore all words that consist of entirely upper case characters. Is this possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are a few ways depending upon your needs. Regular expression can be used to block off text to be ignored. In VS Code settings, you can set it for all file types: or for specific file types:
// To ignore ALL CAPS in all files
"cSpell.ignoreRegExpList": ["/\\b[A-Z]+\\b/g"],
// To ignore ALL CAPS in SQL files
"cSpell.languageSettings": [
{
"languageId": "SQL",
"ignoreRegExpList": ["/\\b[A-Z]+\\b/g"]
}
] Using a languageSettings:
- languageId: SQL
ignoreRegExpList:
- >-
/\b[A-Z]+\b/g |
Beta Was this translation helpful? Give feedback.
There are a few ways depending upon your needs.
Regular expression can be used to block off text to be ignored.
In VS Code settings, you can set it for all file types:
or for specific file types:
.vscode/settings.json
Using a
cspell.config.yaml
file, makes it easier to write regular expressions.