Skip to main content

Enabling file types

Checking is enabled for around 25 file types out of the box. A file type outside that set — or one you would rather not have checked — is switched with a single control, and the choice is stored in your settings.

Enabled by default

AsciiDoc · C, C++ · C# · css, less, scss · Dart · Elixir · Go · Html · Java · JavaScript · JSON / JSONC · LaTeX · Markdown · PHP · PowerShell · Pug / Jade · Python · reStructuredText · Ruby · Rust · Scala · SQL · Text · TypeScript · YAML

If your file is not underlined and its type is absent from that list, that is the reason.

Enable using the cSpell.enableCurrentFileType command

  1. F1 Enable Spell Checking File Type Enable Spell Checking File Type
  2. Choose where to save the setting.

The {} on status bar is the quickest way to see the state of the spell checker: Status Bar Enabled

Configure in the settings

The Commands update the cSpell.enabledFileTypes setting. Editing the setting directly is worth doing when you want the same list committed to a repository, or applied across a team.

{
// Enable / disable checking file types (languageIds).
"cSpell.enabledFileTypes": {
"go": true,
"javascript": true,
"markdown": true,
"plaintext": true,
"typescript": true,
"yaml": true,
"sql": true
}
}

The keys are VS Code language identifiers, not file extensions — plaintext rather than txt, typescriptreact rather than tsx. To find the identifier for the file in front of you, run Change Language Mode from F1; the identifier is shown beside each entry. A key of * is a wildcard that enables all file types, so { "*": true, "json": false } checks everything except JSON.

Placing the setting in .vscode/settings.json applies it to one workspace; placing it in your user settings applies it everywhere.

cSpell.enabledFileTypes replaces the older cSpell.enabledLanguageIds (a plain list of identifiers to enable). If you still have cSpell.enabledLanguageIds in your settings, move its entries into cSpell.enabledFileTypes — see Legacy settings.

Whether the list is an allow list or a block list

cSpell.checkOnlyEnabledFileTypes decides how cSpell.enabledFileTypes is read:

  • true (the default) — only the file types listed as true are checked; everything else is skipped. This is the "around 25 file types out of the box" behavior described above.
  • false — every file type is checked except the ones you explicitly set to false.

Set it to false when it is easier to name the handful of file types to exclude than to list everything you want included.

Other settings affect which files get checked, but answer a different question than "which file types":

Turning the checker off entirely

cSpell.enabled controls the extension as a whole, independently of file types:

{
"cSpell.enabled": false
}

See also: How code is analyzed · Configuration