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

Feature Request: Ability to scan all files and see all spelling issues in the repository #3171

Open deadlydog opened 5 months ago

deadlydog commented 5 months ago

First off, thank you for the wonderful extension! One missing piece of functionality that would be awesome is if you could have the extension scan all files in the repository and display any issues that it finds. I also use the cspell GitHub Action, and find that I often don't notice the issues in VS Code, so it's not until my GitHub Action fails in my CI pipeline that I realize there was a misspelled word. It would be great if we could help "shift left" this issue by:

  1. Have a command that I can manually run in VS Code to scan all files in the repo and report any issues.
  2. Maybe have a dedicated window just for showing spell check errors that we could check at any time and it would show all invalid words in all files in the repo.

Thank you for considering this request.

Jason3S commented 5 months ago

@deadlydog,

Thank you for the detailed request. V4 of the spell checker should have a built-in Terminal REPL that will allow you to spell check files based upon a glob pattern.

At the moment, it is possible to use cspell from the command line to check your project.

cspell .
deadlydog commented 5 months ago

Thanks @Jason3S . While I realize I could install the cspell CLI, it seems kind of redundant to have to do that when it's already installed for the VS Code extension; I just wish VS Code gave us easy access to the CLI path so we could run it from there without having to install it again from NPM.

The v4 terminal REPL sounds closer to what I'm looking for. One of my main use cases is currently I have several open-source projects that use cspell in their CI/CD and PR pipelines. A common frustration is that we don't realize a word is misspelled until the pipeline catches it (after we've committed and pushed up the code). In VS Code I've added Code Spell Checker as a recommended extension, so if it's not installed on the user's PC then VS code will prompt them to install it. There's no easy way to do a similar thing with the cspell CLI though; the best I can do is have documentation in the ReadMe.md/Contributing.md somewhere and hope people read it. Ideally, I would love to have "Scan all files for spelling mistakes" as a keyboard shortcut, and be able to run it from a VS Code Task. That would allow us to more easily "shift left" and get feedback faster. I realize that installing the CLI allows us to do that as well; maybe I'm being picky about having to also install the CLI in addition to the extension, but I think the more options we can give open-source contributors to make their workflows easier, the better.

I haven't made a VS Code extension yet, so I'm not certain if what I'm proposing is possible, or how easy it is to do. I hope you'll keep it in mind for v4 though. Thanks!