Skip to content

chore: add enabling options to create-dictionary - #6037

Merged
Jason3S merged 4 commits into
mainfrom
claude/create-dictionary-enabling-options-9c291a
Nov 6, 2026
Merged

Jason3S merged 4 commits into
mainfrom
claude/create-dictionary-enabling-options-9c291a

Conversation

@Jason3S

@Jason3S Jason3S commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

pnpm create-dictionary can now create dictionaries that have no languageSettings. Until now it could only write a languageSettings entry, and refused a dictionary with no locale or file type, such as a list of company names.

Command cspell-ext.json
--enable-for-all-files The dictionary ID in the top-level dictionaries, no languageSettings
--no-language-settings Empty top-level dictionaries, no languageSettings
--yes with no locale or file type The same as --no-language-settings
A typed * that leaves both the locale and the file type as * Error that names --enable-for-all-files

A disabled dictionary's output says so, and samples/cspell.json lists its ID so its tests still pass:

Created dictionaries/product-names.
It isn't enabled yet. Users have to add it to their settings by adding:
  dictionaries: ['product-names']
If it should be enabled for a language or file type, add languageSettings to cspell-ext.json

--locale and --language-id are allowed with both options, and set only what the samples use.

A locale now comes from a name only when the whole name is a locale. en_AU and german still give one, but en_GB-legacy and it-terms don't. A given file type also rules it out, so en_IN --language-id erlang gets none.

The help no longer mentions *, since typing it never gets you anything that leaving the option out doesn't.

This is the first of three PRs. Next come the dictionary locale, with --dictionary-locale, and then the new prompts. Today's kind question stays for now. docs/designs/create-dictionary.md lists both as not built.

Until the dictionary locale lands, add-samples doesn't see the locale of a dictionary without languageSettings, because it reads it from there. It fetches no Wikipedia article for one, and the guide says so.

Add --enable-for-all-files and --no-language-settings. With no locale or
file type, the command now creates a disabled dictionary and says so.
Both given as "*" stays an error, and names the option for every file.
A locale comes from a name only when the whole name is a locale.
- A locale from the name no longer overrides --locale "*".
- At the prompts, "*" for both fails before any question, and --locale "*" asks for the file type.
- cspell-ext.json for --enable-for-all-files matches Prettier.
- Test the prompt paths with mocked prompts.
- A typed "*" that leaves both the locale and the file type as "*" is an error.
- A given file type rules out a locale from the name.
- The help no longer mentions "*".
@Jason3S
Jason3S merged commit 35657f4 into main Nov 6, 2026
9 checks passed
@Jason3S
Jason3S deleted the claude/create-dictionary-enabling-options-9c291a branch November 6, 2026 15:26
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

Successfully merging this pull request may close these issues.

1 participant