vscode-spell-checker icon indicating copy to clipboard operation
vscode-spell-checker copied to clipboard

GLsizei is read as Lsizei skipping the first G

Open Raffaello opened this issue 1 year ago • 2 comments

see screenshot:

image

Raffaello avatar Dec 31 '23 12:12 Raffaello

@Raffaello,

When looking at camel case and snake case words, the spell checker reports on the least number of errors with the highest percentage of the word being matched.

For example it is common to see both ERRORcode and ERRORCode. The spell checker will accept both. When given ERRORcode it tries both: ["ERRO", "Rcode"] and ["ERROR", "code"]. Since the second option resulting in all words being found in the dictionary, ERRORcode is considered correct. But, if the word was ERRORcodde, it will report only codde as incorrect because it found ERROR in the dictionary.

In the case of GLsizei it tries [GLsizei], [GL,sizei], and [G,Lsizei]. Since G is in the dictionary, it reports Lsizei as the error.

Try experimenting with the following:

// cspell:words GL
const GLsizei width;
// cspell:words sizei
const GLsizei width;
// cspell:words GLsizei
const GLsizei width;

Jason3S avatar Jan 01 '24 09:01 Jason3S

i see. thanks.

i reported because the GLsizei is a typedef of OpenGL, so kind of keyword in C/C++ languages.

How can i add the full word in the dictionary?

Raffaello avatar Jan 01 '24 13:01 Raffaello