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

Code being spellchecked on C++ lines with double and single quotes.

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

spellright Version: 3.0.104 VS Code Version: 1.74.1 (system setup) Windows 10

Spellright shows 'endl' misspelled in this line:

 clog << "getopt() returned ':' optopt = '" << static_cast<char>(optopt) << "'" << endl;

Ben-Voris avatar Dec 17 '22 03:12 Ben-Voris

Workaround: Do not mix double and single quotes on the same line. E.g., if you write this:

clog << "Error: 'SpellRight error with double and single quote '" << endl;

Write this instead:

clog << "Error: \"SpellRight error with double and single quote \"" << endl;

Ben-Voris avatar Feb 21 '23 16:02 Ben-Voris

This problem still occurs in v3.0.112 and is (maybe) worse. That is, endl is marked as misspelled in the following.

cout "\"" << "some text" << "\"" << endl;
cout "\"" << argv[0] << "\"" << endl;

But not in this:

cout "\"some text\"" << endl; 

The general workaround is to break the line. That is, write it like this:

cout "\"" << "some text" << "\""
    << endl;

cout "\"" << argv[0] << "\"" 
    << endl;

Ben-Voris avatar Apr 10 '23 23:04 Ben-Voris