streetsidesoftware / vscode-spell-checker

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

Q: How to spell check `SystemVerilog` and other file types? #3059

Open dseynhae opened 4 months ago

dseynhae commented 4 months ago

I have very common situations where I convert my file into a supported type, to get decent results with the spell checker:

I am actually a bit surprised that this support is not in place in the baseline cSpell product:

Anyway:

Question: is there currently an easier way to get these non-supported file types spell checked? Feature: would it be possible to create a setting that allows automatic association of a filetype with an existing spell checker?

Jason3S commented 4 months ago

@dseynhae,

Thank you for the question.

By default, the spell checker only checks file types that have been enabled. "cSpell.enableFiletypes" is the right setting. It works in conjunction with "cSpell.enableLanguageIds". The initial list comes from "cSpell.enableLanguageIds" and is augmented by "cSpell.enableFiletypes". The hard part is to guess the file type used internally by VSCode. The Spell:Enable Spell Checking Document Language command will handle the change for you.

Using the Spell:Enable Spell Checking Document Language command

  1. Open a file of the type you want to spell check.
  2. Open the command palette
  3. Run: Spell:Enable Spell Checking Document Language
image

Note: Please forgive the misleading name of the command. It is a left over from when VSCode referred to Document Type as Document Language. It still does internally.

That command adds or removes the file type from the enableFiletypes list. By default, shellscript files should be spell checked. If that is not happening for you, I suspect that "cSpell.enableLanguageIds" setting has been changed. Please remove it from your settings and use "cSpell.enableFiletypes" instead to add or remove a file type.