bartosz-antosik / vscode-spellright

Multilingual, Offline and Lightweight Spellchecker for Visual Studio Code
Other
359 stars 36 forks source link

Check identifiers in programming languages #124

Closed kolya-ay closed 6 years ago

kolya-ay commented 6 years ago

Is there any plans to add variables/function names/etc spell-checking as in cspell? I wonder if the info whether some piece of code is keyword or not can be inferred from syntax files used for highlighting.

bartosz-antosik commented 6 years ago

Hi! Sadly, no! Last time I checked there was no way for the extension to have access to the language information used for highlighting (it's inconvenient from more than one point of view). And building this on my own within extension is impossible because other extensions can register language definitions.

The parsers I created use some heuristics to select elements like comments and strings plus sometimes other elements, but spelling identifiers would require nearly compiler level parsing of source code files.

I think there is another extension which does "total" spelling of just everything so it probably spells identifiers as well. This is not the way my extension does things as I prefer to have carefully selected elements to spell.

kolya-ay commented 6 years ago

Fair enough, I take you point. Completely agree that maintaining separate list of keywords isn't the way to go. I've just up-voted Microsoft/vscode#580. BTW, have you seen scope-info mentioned in the thread?

Curious to think now that I used to believe that spellchecking is somewhat resolved problem just a couple days ago..

bartosz-antosik commented 6 years ago

Exactly as you say, it's somehow resolved. Have you per chance seen this issue: #20266? It says bit more about spelling in VSCode. I am myself not happy about few things here, like the the whole "diagnostics" interface etc.

Somehow this scope-info extension does not work for me. I will have to analyze it. Thanks for the hints.

kolya-ay commented 6 years ago

Have you per chance seen this issue: #20266?

Thanks. Postponed it to home-reading to thoughtfully go through all the rationale.

Exactly as you say, it's somehow resolved

Just realized that /usr/share/hunspell/ru_RU.* files (I'm from Cyrillic world) which come with default Debian package are in KOI8-R encoding. What the.. mess?

Thank you for your effort! I'll probably borrow the way you package native node extensions;)

bartosz-antosik commented 6 years ago

You will find much more about native packages in the thread mentioned.

There should be an UTF-8 version of the Russian dictionary for Hunspell around. I know distros bring a variety of versions. Also you may want to see (#50).

Out of curiosity - is there something that should work differently for Russian spelling in Spell Right?