Skip to content

Use directives of "Code Spell Checker" for Visual Code #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
crjeder opened this issue Jun 20, 2024 · 2 comments
Open

Use directives of "Code Spell Checker" for Visual Code #333

crjeder opened this issue Jun 20, 2024 · 2 comments

Comments

@crjeder
Copy link

crjeder commented Jun 20, 2024

For Visual Code there is a quite popular spell checker plug-in which uses in document settings like:

// spell-checker:words Pan Galactic Gargle Blaster

to add words to the dictionary or to turn spellchecking off for a paragraph. I like this solution and it would be a nice combination to use cargo-spellcheck as a quality gate in the pipeline and the plug-in for interactive checking.

I'd like to use both tools with the same configuration stored in one place.

Of course the feature could be implemented by an shell script which syncs both configurations, but this would neither be convenient nor robust.

@drahnr
Copy link
Owner

drahnr commented Jun 21, 2024

@crjeder could you list the set of directives that you use and the scope they are valid for? Otherwise this is a moving target :) I agree the above would be nice, a single source of truth for spellchecking.

@crjeder
Copy link
Author

crjeder commented Jun 21, 2024

That's from the documentation of cSpell:

All settings are prefixed with cSpell: or spell-checker:

- disable -- turn off the spell checker for a section of code.
- enable -- turn the spell checker back on after it has been turned off.
- ignore -- specify a list of words to be ignored.
- words -- specify a list of words to be considered correct and will appear in the suggestions list.
- locale -- set locale (example: cSpell:locale fr,en to use French and English languages)
- ignoreRegExp -- Any text matching the regular expression will NOT be checked for spelling.
- includeRegExp -- Only text matching the collection of includeRegExp will be checked.
- enableCompoundWords / disableCompoundWords -- Allow / disallow words like: "stringlength".

To be generic I think it would be a good idea to use the spell-checker: prefix
The directives I use are:

  • enable
  • disable
  • words

The others make sense, too. But are not as important for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants