Skip to content

Commit

Permalink
fix: Set enabledFileTypes default to be easier to extend (#3807)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S authored Nov 19, 2024
1 parent 212526a commit c740c4e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 146 deletions.
69 changes: 2 additions & 67 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1944,73 +1944,8 @@
"type": "boolean"
},
"default": {
"al": true,
"asciidoc": true,
"bat": true,
"c": true,
"clojure": true,
"coffeescript": true,
"cpp": true,
"csharp": true,
"css": true,
"dart": true,
"diff": true,
"dockerfile": true,
"elixir": true,
"erlang": true,
"fsharp": true,
"git-commit": true,
"git-rebase": true,
"github-actions-workflow": true,
"go": true,
"graphql": true,
"groovy": true,
"handlebars": true,
"haskell": true,
"html": true,
"ini": true,
"jade": true,
"java": true,
"javascript": true,
"javascriptreact": true,
"json": true,
"jsonc": true,
"julia": true,
"jupyter": true,
"latex": true,
"less": true,
"lua": true,
"makefile": true,
"markdown": true,
"objective-c": true,
"perl": true,
"perl6": true,
"php": true,
"plaintext": true,
"powershell": true,
"properties": true,
"pug": true,
"python": true,
"r": true,
"razor": true,
"restructuredtext": true,
"ruby": true,
"rust": true,
"scala": true,
"scminput": true,
"scss": true,
"shaderlab": true,
"shellscript": true,
"sql": true,
"swift": true,
"text": true,
"typescript": true,
"typescriptreact": true,
"vb": true,
"vue": true,
"xml": true,
"xsl": true,
"yaml": true
"*": true,
"markdown": true
},
"markdownDescription": "Enable / Disable checking file types (languageIds).\n\nThis setting replaces: `#cSpell.enabledLanguageIds#` and `#cSpell.enableFiletypes#`.\n\nA Value of:\n- `true` - enable checking for the file type\n- `false` - disable checking for the file type\n\nA file type of `*` is a wildcard that enables all file types.\n\n**Example: enable all file types**\n\n| File Type | Enabled | Comment |\n| --------- | ------- | ------- |\n| `*` | `true` | Enable all file types. |\n| `json` | `false` | Disable checking for json files. |",
"scope": "resource",
Expand Down
69 changes: 2 additions & 67 deletions packages/_server/spell-checker-config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1411,73 +1411,8 @@
"type": "boolean"
},
"default": {
"al": true,
"asciidoc": true,
"bat": true,
"c": true,
"clojure": true,
"coffeescript": true,
"cpp": true,
"csharp": true,
"css": true,
"dart": true,
"diff": true,
"dockerfile": true,
"elixir": true,
"erlang": true,
"fsharp": true,
"git-commit": true,
"git-rebase": true,
"github-actions-workflow": true,
"go": true,
"graphql": true,
"groovy": true,
"handlebars": true,
"haskell": true,
"html": true,
"ini": true,
"jade": true,
"java": true,
"javascript": true,
"javascriptreact": true,
"json": true,
"jsonc": true,
"julia": true,
"jupyter": true,
"latex": true,
"less": true,
"lua": true,
"makefile": true,
"markdown": true,
"objective-c": true,
"perl": true,
"perl6": true,
"php": true,
"plaintext": true,
"powershell": true,
"properties": true,
"pug": true,
"python": true,
"r": true,
"razor": true,
"restructuredtext": true,
"ruby": true,
"rust": true,
"scala": true,
"scminput": true,
"scss": true,
"shaderlab": true,
"shellscript": true,
"sql": true,
"swift": true,
"text": true,
"typescript": true,
"typescriptreact": true,
"vb": true,
"vue": true,
"xml": true,
"xsl": true,
"yaml": true
"*": true,
"markdown": true
},
"description": "Enable / Disable checking file types (languageIds).\n\nThis setting replaces: `#cSpell.enabledLanguageIds#` and `#cSpell.enableFiletypes#`.\n\nA Value of:\n- `true` - enable checking for the file type\n- `false` - disable checking for the file type\n\nA file type of `*` is a wildcard that enables all file types.\n\n**Example: enable all file types**\n\n| File Type | Enabled | Comment | | --------- | ------- | ------- | | `*` | `true` | Enable all file types. | | `json` | `false` | Disable checking for json files. |",
"markdownDescription": "Enable / Disable checking file types (languageIds).\n\nThis setting replaces: `#cSpell.enabledLanguageIds#` and `#cSpell.enableFiletypes#`.\n\nA Value of:\n- `true` - enable checking for the file type\n- `false` - disable checking for the file type\n\nA file type of `*` is a wildcard that enables all file types.\n\n**Example: enable all file types**\n\n| File Type | Enabled | Comment |\n| --------- | ------- | ------- |\n| `*` | `true` | Enable all file types. |\n| `json` | `false` | Disable checking for json files. |",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,7 @@ export interface FileTypesAndSchemeSettings {
*
* @title Enabled File Types to Check
* @scope resource
* @default { "al": true, "asciidoc": true, "bat": true, "c": true, "clojure": true, "coffeescript": true, "cpp": true, "csharp": true, "css": true,
* "dart": true, "diff": true, "dockerfile": true, "elixir": true, "erlang": true, "fsharp": true, "git-commit": true,
* "git-rebase": true, "github-actions-workflow": true, "go": true, "graphql": true, "groovy": true, "handlebars": true,
* "haskell": true, "html": true, "ini": true, "jade": true, "java": true, "javascript": true, "javascriptreact": true,
* "json": true, "jsonc": true, "julia": true, "jupyter": true, "latex": true, "less": true, "lua": true, "makefile": true,
* "markdown": true, "objective-c": true, "perl": true, "perl6": true, "php": true, "plaintext": true, "powershell": true,
* "properties": true, "pug": true, "python": true, "r": true, "razor": true, "restructuredtext": true, "ruby": true,
* "rust": true, "scala": true, "scminput": true, "scss": true, "shaderlab": true, "shellscript": true, "sql": true, "swift": true,
* "text": true, "typescript": true, "typescriptreact": true, "vb": true, "vue": true, "xml": true, "xsl": true, "yaml": true
* }
* @default { "*" : true, "markdown": true }
*/
enabledFileTypes?: EnabledFileTypes;

Expand Down
3 changes: 1 addition & 2 deletions packages/client/src/settings/languageIds.test.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { describe, expect, test } from 'vitest';

import { readDefaults } from '../test/schema.mjs';
import { languageIds } from './languageIds.js';

describe('settings/index', () => {
test('Default languageIds', async () => {
Expand All @@ -12,7 +11,7 @@ describe('settings/index', () => {
.filter(([, enabled]) => enabled)
.map(([lang]) => lang)
.sort();
expect([...languageIds].sort()).toEqual(enabled);
expect(['*', 'markdown'].sort()).toEqual(enabled);
expect(enabledLanguageIds).toBeUndefined();
});
});

0 comments on commit c740c4e

Please sign in to comment.