streetsidesoftware / vscode-spell-checker

A simple source code spell checker for code
https://streetsidesoftware.github.io/vscode-spell-checker/
Other
1.41k stars 126 forks source link

Ignore words define/declared outside the project #3243

Open Nahor opened 4 months ago

Nahor commented 4 months ago

Assuming it's possible, it would be great if the extension could query the language server to check if an unknown word matches an entity declared/defined outside the project (system headers, Rust crates, NPM packages, ...). This would help automatically ignore words that are created by third-party libraries and remove the tedium to ignore the same words over and over just because a library is popular and used in a lot of different projects.

There would be 3 states:

Maybe also add an action to get both lists so a developer could add those words to dictionaries/configuration files and be ignored when running cspell checks without the language server

JesseRap commented 3 months ago

I recently started using this extension, and I strongly agree.

Is this the same root issue as in this Issue? https://github.com/streetsidesoftware/vscode-spell-checker/issues/3205

Intuitively, we should be allowed to configure the Spell Checker to ignore an unknown word if it is a named parameter of a third-party library function, or if it is the name of a function or method in a third-party library. VS Code is already able to "know" this - incorporating this capacity into the extension would make it much easier to use, and not require ad hoc ignoring of certain lines or adding words to the dictionary.

Nahor commented 3 months ago

Indeed, those two issues have the same end goal. Thanks for pointing it out.

In my opinion though, my proposed solution is more generic (it doesn't rely on external tools, nor is limited to installed libraries) and more dynamic (i.e. update automatically when new/updated libraries). I also think the solution in #3205 would work better as an third-party tool, which could then also be used outside vscode.

So I'll leave this issue opened and let the maintainers choose which one to close a duplicate of the other.