vscode-spellright icon indicating copy to clipboard operation
vscode-spellright copied to clipboard

Do not check words preceeded with % (percent)

Open Ben-Voris opened this issue 2 years ago • 1 comments

I like to spell check strings, but this means that C code like this produces multiple spelling errors:

printf ("%hd %ld %Ld\n", shortInt, longInt, longlongInt);

I could add hd, ld, and Ld as words, but they should be flagged as spelling errors unless prefixed with the % (and they probably should only be ignored in C and C++ files.

I tried adding "spellright.ignoreRegExps": ["%hd", "%ld"] but the extension complains that both are malformed. (Fwiw https://regex101.com/ thinks these are valid JavaScript regexs.). I also tried "spellright.ignoreRegExps": ["/%hd/g", "/%ld/g"] . This gave no error, but it had no effect.

In a relatively tiny C program, I see > 100 spelling errors for these format strings.

Can you help?

Ben-Voris avatar Jan 26 '22 02:01 Ben-Voris