Repository navigation
chore: add enabling options to create-dictionary - #6037
Merged
Merged
Conversation
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.
…ary-enabling-options-9c291a
- 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 "*".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pnpm create-dictionarycan now create dictionaries that have nolanguageSettings. Until now it could only write alanguageSettingsentry, and refused a dictionary with no locale or file type, such as a list of company names.cspell-ext.json--enable-for-all-filesdictionaries, nolanguageSettings--no-language-settingsdictionaries, nolanguageSettings--yeswith no locale or file type--no-language-settings*that leaves both the locale and the file type as*--enable-for-all-filesA disabled dictionary's output says so, and
samples/cspell.jsonlists its ID so its tests still pass:--localeand--language-idare 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_AUandgermanstill give one, buten_GB-legacyandit-termsdon't. A given file type also rules it out, soen_IN --language-id erlanggets 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.mdlists both as not built.Until the dictionary locale lands,
add-samplesdoesn't see the locale of a dictionary withoutlanguageSettings, because it reads it from there. It fetches no Wikipedia article for one, and the guide says so.