diff --git a/docs/_includes/generated-docs/configuration.md b/docs/_includes/generated-docs/configuration.md index c9294804f3..efb29ed256 100644 --- a/docs/_includes/generated-docs/configuration.md +++ b/docs/_includes/generated-docs/configuration.md @@ -1136,7 +1136,7 @@ Default | [`cSpell.blockCheckingWhenAverageChunkSizeGreaterThan`](#cspellblockcheckingwhenaveragechunksizegreaterthan) | language-overridable | The maximum average length of chunks of text without word breaks. | | [`cSpell.blockCheckingWhenLineLengthGreaterThan`](#cspellblockcheckingwhenlinelengthgreaterthan) | language-overridable | The maximum line length. | | [`cSpell.blockCheckingWhenTextChunkSizeGreaterThan`](#cspellblockcheckingwhentextchunksizegreaterthan) | language-overridable | The maximum length of a chunk of text without word breaks. | -| [`cSpell.checkLimit`](#cspellchecklimit) | resource | The limit in K-Characters to be checked in a file. | +| [`cSpell.checkLimit`](#cspellchecklimit) | resource | Set the maximum number of bocks of text to check. Each block is 1024 characters. | | [`cSpell.spellCheckDelayMs`](#cspellspellcheckdelayms) | application | Delay in ms after a document has changed before checking it for spelling errors. | | [`cSpell.suggestionsTimeout`](#cspellsuggestionstimeout) | resource | The maximum amount of time in milliseconds to generate suggestions for a word. | @@ -1240,7 +1240,8 @@ Scope : resource Description -: The limit in K-Characters to be checked in a file. +: Set the maximum number of bocks of text to check. +Each block is 1024 characters. Default : _`500`_ @@ -1287,12 +1288,13 @@ Default # CSpell -| Setting | Scope | Description | -| ------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------ | -| [`cSpell.ignoreRegExpList`](#cspellignoreregexplist) | resource | List of regular expressions or Pattern names (defined in `#cSpell.patterns#`) to exclude from… | -| [`cSpell.includeRegExpList`](#cspellincluderegexplist) | resource | List of regular expression patterns or defined pattern names to match for spell checking. | -| [`cSpell.overrides`](#cspelloverrides) | resource | Overrides are used to apply settings for specific files in your project. | -| [`cSpell.patterns`](#cspellpatterns) | resource | Defines a list of patterns that can be used with the `#cSpell.ignoreRegExpList#` and `#cSpell.includeRegExpList#`… | +| Setting | Scope | Description | +| ---------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------ | +| [`cSpell.ignoreRegExpList`](#cspellignoreregexplist) | resource | List of regular expressions or Pattern names (defined in `#cSpell.patterns#`) to exclude from… | +| [`cSpell.includeRegExpList`](#cspellincluderegexplist) | resource | List of regular expression patterns or defined pattern names to match for spell checking. | +| [`cSpell.overrides`](#cspelloverrides) | resource | Overrides are used to apply settings for specific files in your project. | +| [`cSpell.patterns`](#cspellpatterns) | resource | Defines a list of patterns that can be used with the `#cSpell.ignoreRegExpList#` and `#cSpell.includeRegExpList#`… | +| [`cSpell.useLocallyInstalledCSpellDictionaries`](#cspelluselocallyinstalledcspelldictionaries) | resource | Search for `@cspell/cspell-bundled-dicts` in the workspace folder and use it if found. | ## Definitions @@ -1420,6 +1422,28 @@ Default --- +### `cSpell.useLocallyInstalledCSpellDictionaries` + +Name +: `cSpell.useLocallyInstalledCSpellDictionaries` + +Type +: boolean + +Scope +: resource + +Description +: Search for `@cspell/cspell-bundled-dicts` in the workspace folder and use it if found. + +Default +: _`true`_ + +Version +: 4.0.0 + +--- + # Appearance | Setting | Scope | Description | diff --git a/package-lock.json b/package-lock.json index c30517a561..4427d499ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,10 +28,10 @@ "packages/_integrationTests" ], "dependencies": { - "@cspell/cspell-bundled-dicts": "^8.1.0", - "@cspell/cspell-types": "^8.1.0", + "@cspell/cspell-bundled-dicts": "^8.1.2", + "@cspell/cspell-types": "^8.1.2", "@types/react": "^17.0.71", - "cspell": "^8.1.0", + "cspell": "^8.1.2", "regexp-worker": "^2.0.2" }, "devDependencies": { @@ -726,9 +726,9 @@ "license": "MIT" }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.1.0.tgz", - "integrity": "sha512-o/R/kR1QO9SQV2hUroaguTlHD6MDDtrVY6Xj5eG0loM7T0Pm3TEdlGYQ0LP6O9/CfUiHTntIFUM+PJ999+LuHQ==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.1.2.tgz", + "integrity": "sha512-K/+0HJs6ka8y+f4D5nO24vz8aVIFaOOUfvRdQl1sB8zvAPymtEYy4TOF/F2GUD5aDl1+bHIPJOPgbGDl3ANl+w==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.0", @@ -784,28 +784,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.1.0.tgz", - "integrity": "sha512-Iss9dq5XBc5wYADv/Z59W4DgRQYs8BSHNVD6+LbQctuqmeJAte426/oi4x0Y76AJtEe0N6BZouj8HXykovwP5w==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.1.2.tgz", + "integrity": "sha512-IDKXMgBdgRK7gLFajkGZ9iwKRwtPzsxUFd/srTF6Tm4u823B9f88nIpHbIIKYvgFGRFq06KSIUsEepH54M1ymA==", "dependencies": { - "@cspell/cspell-types": "8.1.0" + "@cspell/cspell-types": "8.1.2" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.1.0.tgz", - "integrity": "sha512-HDNX7MFAPAJ9acyYBa1bG+P4WiHHMFNYeywYBf3h6ScVhHobAqnhqS6b8R7MVhVRivwnKIQPG3zK7UpcwfyRcw==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.1.2.tgz", + "integrity": "sha512-RIWQQphAtMYtIeclBdLnd/vc8kr9spWdrmTtiVYkBKG1B+BvEXfGzYc6BGT5tSWxYVTjzbyRJxZJ9pEIw5LUgw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.1.0.tgz", - "integrity": "sha512-nlppKh2o6g0zz+oIQ/dZB+oFQFf8lvn3mJKBpDwoeQY7/o9ZORPibXjtqXM83OhhdpoUVuk+3RFMsnFBBffa2Q==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.1.2.tgz", + "integrity": "sha512-fZwLkyFToxzA+HZ6YL7nJazrvZTqnSYD/Fy1PR9u6M90jGUY6nIcr7LBKtfDYB6wWE3ygtAUCx0soGssSlmyMw==", "dependencies": { "global-directory": "^4.0.1" }, @@ -814,17 +814,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.1.0.tgz", - "integrity": "sha512-9Enayhkef732f15kHgiUe4QKyJgKk1dcZ4EFq4eyzUUDFF/eBv6qTQo5k2juUhPIjaKosqqMBHg4ffXcpkhr+Q==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.1.2.tgz", + "integrity": "sha512-bvocFYE1LYe8aBYzG6qMSAj3JWdvRY1zaaoXXV7jkIs2jdBBsSvb6wXAKXn6Z2mjeKAD4y38tD6f9aq17hcSyQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.1.0.tgz", - "integrity": "sha512-1SxBjQdZtVjrTs3Ftw5I3nNpuDjdpsFMvfbbt6EnxqMpmZiUwkqxLCKla0pEy5R9CZcFFlntlOTMTmNsIkgmWg==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.1.2.tgz", + "integrity": "sha512-ApVEfLN7G9uBpZOVCjBCTayhEJ1N++P9kBfsS1LWQk14qeTm/char9reVQq2s9kkGrPYEEda+hvGC8K0Y07UUg==", "engines": { "node": ">=18" } @@ -1051,9 +1051,9 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.1.0.tgz", - "integrity": "sha512-TJ1OnP0ubdVr5YTMU15rVs8R6ROuPvP/Z5lY2gtHscEsf9tZxvIt3924uMc9fTJXgNsITNWSoCzgwJYcDvGM6A==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.1.2.tgz", + "integrity": "sha512-S0I/VoZvuJvrVgqhxyHCrvHFGAZR6KxoPAr4FMrzVx00hYWZUdCanA494DYXwA5NXisyHlZrpga6H18mVjvIUw==", "dependencies": { "import-meta-resolve": "^4.0.0" }, @@ -1062,9 +1062,9 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.1.0.tgz", - "integrity": "sha512-yBc3ejGpx3QLbfS+Sec8ycS+lKuou5rnnpfz3aVBCnNHUPozosFuNYPFB6Iah2CBY6v6rkDCkIp5vnp1IwQzdA==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.1.2.tgz", + "integrity": "sha512-oG3Iz9FV0rTAu34BgXIv5JUyR1legUyFzKWboFCsW9iyTAjViA8aIG6q0ZD7xK84Ugi385jW8XfJB0vb8A1qIQ==", "engines": { "node": ">=18" } @@ -5898,21 +5898,21 @@ } }, "node_modules/cspell": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.1.0.tgz", - "integrity": "sha512-oxQLyhW3yIAfvDdtoobvriWqfWVqOBo1o+WWRxlDyJdKDBH6my++p6KU3ZjxcJb7VG+CRLGfU7zASWwTPxMXRA==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.1.2.tgz", + "integrity": "sha512-MOU+lwbzzXT1mcrLCYb9ecfPtquuys9RQy6KehU4S1Oub4715LiXct6+DqDt8NK6w4R3WRo9ixh1bnL3LoVEMw==", "dependencies": { - "@cspell/cspell-json-reporter": "8.1.0", - "@cspell/cspell-pipe": "8.1.0", - "@cspell/cspell-types": "8.1.0", - "@cspell/dynamic-import": "8.1.0", + "@cspell/cspell-json-reporter": "8.1.2", + "@cspell/cspell-pipe": "8.1.2", + "@cspell/cspell-types": "8.1.2", + "@cspell/dynamic-import": "8.1.2", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^11.1.0", - "cspell-gitignore": "8.1.0", - "cspell-glob": "8.1.0", - "cspell-io": "8.1.0", - "cspell-lib": "8.1.0", + "cspell-gitignore": "8.1.2", + "cspell-glob": "8.1.2", + "cspell-io": "8.1.2", + "cspell-lib": "8.1.2", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^7.0.2", @@ -5933,11 +5933,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.1.0.tgz", - "integrity": "sha512-mIv8etMAp05OapdxJQt0nkfzclMti8AfACPryWnVePrwB89A2KjErHYBa7hX6gn20B4K+KgD7ckPcOi6L8vLYA==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.1.2.tgz", + "integrity": "sha512-iJKSY895AnnGAhjZN7HLfRZ3bAUuJKmZ9kmpFB9CJcMTERazBQuxGSx5AjjpB3b1kOM4T9Dgm++jcvbgwH5DbQ==", "dependencies": { - "@cspell/cspell-types": "8.1.0", + "@cspell/cspell-types": "8.1.2", "comment-json": "^4.2.3", "yaml": "^2.3.4" }, @@ -5946,13 +5946,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.1.0.tgz", - "integrity": "sha512-nwvlPiM7jsZThZ2bUS2CYzqwAbxWC4OL5GozQfbGEwW/8unNhifBpJzlOZuzLyX4Vu94ETExeIc625wBqPWjVA==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.1.2.tgz", + "integrity": "sha512-MB244J4hSFlEqZ/3DP1yM5VN4DAaL6ki4axjgrOaJJyHcVe6WRIbiJBxOcBw0WmWzyZHFZVBXC/dnV0ydpXL8A==", "dependencies": { - "@cspell/cspell-pipe": "8.1.0", - "@cspell/cspell-types": "8.1.0", - "cspell-trie-lib": "8.1.0", + "@cspell/cspell-pipe": "8.1.2", + "@cspell/cspell-types": "8.1.2", + "cspell-trie-lib": "8.1.2", "fast-equals": "^5.0.1", "gensequence": "^6.0.0" }, @@ -5961,11 +5961,11 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.1.0.tgz", - "integrity": "sha512-upMIEjbBz1g92Vt80h2hMMRZ9057iAmCWxi05l0WrwGrtc3CGsA8gQQIFIbVZ0x86Sbmv1cBZms1Y/hKWPWuvg==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.1.2.tgz", + "integrity": "sha512-fytNCWAyd7oX5oDstx63pLf43YY43CvRWi5gi2E2EUj8VzzbfXwkCwBlIfjupoZ0HFk85LSy9ESVoJ7uO1Of9g==", "dependencies": { - "cspell-glob": "8.1.0", + "cspell-glob": "8.1.2", "find-up-simple": "^1.0.0" }, "bin": { @@ -5976,9 +5976,9 @@ } }, "node_modules/cspell-glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.1.0.tgz", - "integrity": "sha512-onPRqJqPZaaUQ1CKeuh2fJJ9UjIBicRq6Ffd6bqWCu7IdwfEBPtjWa/nlEjCVp1CMRwhS3Y0zG3jHkKLydsR4Q==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.1.2.tgz", + "integrity": "sha512-fd4GVUhHMbikSIQjFrHJILPj7X6qfhnQYYMRLx3oIARhQAvbQpx6KzVVUKJ6yMP++dqLFBSs+9KIe/IJyRx5zw==", "dependencies": { "micromatch": "^4.0.5" }, @@ -5987,12 +5987,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.1.0.tgz", - "integrity": "sha512-E28SDJYOOuHk8eBtMSIGyCu8qiKb/H4LX1J/kw8+eV0RLvnllmq2FAYFBk8jtu4uW49TW5n/eLg7J2TvPONYAA==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.1.2.tgz", + "integrity": "sha512-642YdsUWpGgAih7Dibrxa9g4+drC/DYWlGj0tiRWd9Ge93QC9Iz3344D3RBD11yXs7+uvCQcLCJBDK+49LGE8A==", "dependencies": { - "@cspell/cspell-pipe": "8.1.0", - "@cspell/cspell-types": "8.1.0" + "@cspell/cspell-pipe": "8.1.2", + "@cspell/cspell-types": "8.1.2" }, "bin": { "cspell-grammar": "bin.mjs" @@ -6002,36 +6002,36 @@ } }, "node_modules/cspell-io": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.1.0.tgz", - "integrity": "sha512-oPRMS/XUWcdZXMj6Zhs65mgOVyRZajAhHLm18o6cPLOGUD0770oMqi8ZNKj7LuvubkyP/NL0m4AEcWwvmz/Cbw==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.1.2.tgz", + "integrity": "sha512-4KUJd2Q8k9stb//iDHpORTBBz0uM8YHa8KA2iSUdJj4D6eA5nTLc0Vzt6y89MrUjPlkzk8kyV848McZfodQtRQ==", "dependencies": { - "@cspell/cspell-service-bus": "8.1.0" + "@cspell/cspell-service-bus": "8.1.2" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.1.0.tgz", - "integrity": "sha512-tatdY9teElqqPtKHAY1osOhV68h/f3x+4Niw7rV12OXmJ9El1lPka59bVTV401fODWRoF3WWJXUpTg012zhdrQ==", - "dependencies": { - "@cspell/cspell-bundled-dicts": "8.1.0", - "@cspell/cspell-pipe": "8.1.0", - "@cspell/cspell-resolver": "8.1.0", - "@cspell/cspell-types": "8.1.0", - "@cspell/dynamic-import": "8.1.0", - "@cspell/strong-weak-map": "8.1.0", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.1.2.tgz", + "integrity": "sha512-UJjuaZ/ZXIXiWFVLGgVJu6VftWHujQaeUgjlQxePvAqI0QdzR9G5vsJ80BGaoldhhKyWxCCq/Gx6PaeWWNzJ5Q==", + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.1.2", + "@cspell/cspell-pipe": "8.1.2", + "@cspell/cspell-resolver": "8.1.2", + "@cspell/cspell-types": "8.1.2", + "@cspell/dynamic-import": "8.1.2", + "@cspell/strong-weak-map": "8.1.2", "clear-module": "^4.1.2", "comment-json": "^4.2.3", "configstore": "^6.0.0", - "cspell-config-lib": "8.1.0", - "cspell-dictionary": "8.1.0", - "cspell-glob": "8.1.0", - "cspell-grammar": "8.1.0", - "cspell-io": "8.1.0", - "cspell-trie-lib": "8.1.0", + "cspell-config-lib": "8.1.2", + "cspell-dictionary": "8.1.2", + "cspell-glob": "8.1.2", + "cspell-grammar": "8.1.2", + "cspell-io": "8.1.2", + "cspell-trie-lib": "8.1.2", "fast-equals": "^5.0.1", "gensequence": "^6.0.0", "import-fresh": "^3.3.0", @@ -6044,12 +6044,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.1.0.tgz", - "integrity": "sha512-OF5ZNuGPIGg2CCMdMeAgd1I2iVDjoelpMjVDyqpuNu+RVpAkmNRqMFDBlsnJPWCCeOLn7blWPMBZW2KXctsm3Q==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.1.2.tgz", + "integrity": "sha512-TfNRr8XI8ObHjSalnbeF256HyG+cHNDeQSSy5n0Y+UomaSo3Cyy7Z91+0WtND8hdw206jhKiqZqGtzf8ojniDg==", "dependencies": { - "@cspell/cspell-pipe": "8.1.0", - "@cspell/cspell-types": "8.1.0", + "@cspell/cspell-pipe": "8.1.2", + "@cspell/cspell-types": "8.1.2", "gensequence": "^6.0.0" }, "engines": { @@ -19342,9 +19342,9 @@ } }, "node_modules/terser": { - "version": "5.24.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.24.0.tgz", - "integrity": "sha512-ZpGR4Hy3+wBEzVEnHvstMvqpD/nABNelQn/z2r0fjVWGQsN3bpOLzQlqDxmb4CDZnXq5lpjnQ+mHQLAOpfM5iw==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.25.0.tgz", + "integrity": "sha512-we0I9SIsfvNUMP77zC9HG+MylwYYsGFSBG8qm+13oud2Yh+O104y614FRbyjpxys16jZwot72Fpi827YvGzuqg==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -21978,8 +21978,8 @@ "name": "@internal/cspell-helper", "version": "1.0.0", "dependencies": { - "@cspell/cspell-types": "^8.1.0", - "cspell-lib": "^8.1.0" + "@cspell/cspell-types": "^8.1.2", + "cspell-lib": "^8.1.2" }, "bin": { "build": "build.mjs" @@ -22030,7 +22030,7 @@ "mocha": "^10.2.0" }, "devDependencies": { - "@cspell/cspell-types": "^8.1.0", + "@cspell/cspell-types": "^8.1.2", "@types/chai": "^4.3.11", "@types/decompress": "^4.2.7", "@types/glob": "^8.1.0", @@ -22467,13 +22467,14 @@ "version": "2.0.0", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "^8.1.0", - "@cspell/cspell-pipe": "^8.1.0", - "@cspell/cspell-types": "^8.1.0", + "@cspell/cspell-bundled-dicts": "^8.1.2", + "@cspell/cspell-pipe": "^8.1.2", + "@cspell/cspell-types": "^8.1.2", "@internal/common-utils": "file:../__utils", - "cspell-gitignore": "^8.1.0", - "cspell-glob": "^8.1.0", - "cspell-lib": "^8.1.0", + "cspell-config-lib": "^8.1.2", + "cspell-gitignore": "^8.1.2", + "cspell-glob": "^8.1.2", + "cspell-lib": "^8.1.2", "gensequence": "^6.0.0", "json-rpc-api": "file:../json-rpc-api", "node-watch": "^0.7.4", @@ -22506,9 +22507,9 @@ "version": "2.0.0", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "^8.1.0", + "@cspell/cspell-types": "^8.1.2", "@internal/common-utils": "file:../__utils", - "cspell-lib": "^8.1.0", + "cspell-lib": "^8.1.2", "regexp-worker": "^2.0.2", "vscode-languageserver": "^9.0.1", "vscode-languageserver-textdocument": "^1.0.11", @@ -22552,7 +22553,7 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "react-test-renderer": "^17.0.2", - "terser": "^5.24.0", + "terser": "^5.25.0", "terser-webpack-plugin": "^5.3.9", "ts-loader": "^9.5.1", "vscode-uri": "^3.0.8", @@ -22579,7 +22580,7 @@ "version": "2.0.0", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "^8.1.0", + "@cspell/cspell-types": "^8.1.2", "@internal/common-utils": "file:../__utils", "@internal/settings-webview": "file:../_settingsViewer", "code-spell-checker-server": "file:../_server", @@ -22604,7 +22605,7 @@ "@types/kefir": "^3.8.11", "@types/source-map-support": "^0.5.10", "cross-env": "^7.0.3", - "cspell-lib": "^8.1.0", + "cspell-lib": "^8.1.2", "lorem-ipsum": "^2.0.8", "rfdc": "^1.3.0", "source-map-support": "^0.5.21", diff --git a/package.json b/package.json index dc8849663b..142249bf26 100644 --- a/package.json +++ b/package.json @@ -1395,6 +1395,13 @@ "markdownDescription": "Defines a list of patterns that can be used with the `#cSpell.ignoreRegExpList#` and\n`#cSpell.includeRegExpList#` options.\n\n**Example:**\n\n```jsonc\n\"cSpell.patterns\": [\n {\n \"name\": \"comment-single-line\",\n \"pattern\": \"/#.*​/g\"\n },\n {\n \"name\": \"comment-multi-line\",\n \"pattern\": \"/(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)/g\"\n }\n]\n```", "scope": "resource", "type": "array" + }, + "cSpell.useLocallyInstalledCSpellDictionaries": { + "default": true, + "markdownDescription": "Search for `@cspell/cspell-bundled-dicts` in the workspace folder and use it if found.", + "scope": "resource", + "type": "boolean", + "version": "4.0.0" } }, "title": "CSpell", @@ -3078,7 +3085,7 @@ }, "cSpell.checkLimit": { "default": 500, - "markdownDescription": "The limit in K-Characters to be checked in a file.", + "markdownDescription": "Set the maximum number of bocks of text to check.\nEach block is 1024 characters.", "scope": "resource", "type": "number" }, @@ -3351,10 +3358,10 @@ "vitest": "^0.34.6" }, "dependencies": { - "@cspell/cspell-bundled-dicts": "^8.1.0", - "@cspell/cspell-types": "^8.1.0", + "@cspell/cspell-bundled-dicts": "^8.1.2", + "@cspell/cspell-types": "^8.1.2", "@types/react": "^17.0.71", - "cspell": "^8.1.0", + "cspell": "^8.1.2", "regexp-worker": "^2.0.2" }, "comment-resolutions": { diff --git a/packages/__cspell-helper/package.json b/packages/__cspell-helper/package.json index 614599e216..04168b1987 100644 --- a/packages/__cspell-helper/package.json +++ b/packages/__cspell-helper/package.json @@ -22,8 +22,8 @@ "yargs": "^17.7.2" }, "dependencies": { - "@cspell/cspell-types": "^8.1.0", - "cspell-lib": "^8.1.0" + "@cspell/cspell-types": "^8.1.2", + "cspell-lib": "^8.1.2" }, "engines": { "node": ">18.0.0" diff --git a/packages/_integrationTests/package.json b/packages/_integrationTests/package.json index cb0943c008..007691051b 100644 --- a/packages/_integrationTests/package.json +++ b/packages/_integrationTests/package.json @@ -23,7 +23,7 @@ "author": "", "license": "MIT", "devDependencies": { - "@cspell/cspell-types": "^8.1.0", + "@cspell/cspell-types": "^8.1.2", "@types/chai": "^4.3.11", "@types/decompress": "^4.2.7", "@types/glob": "^8.1.0", diff --git a/packages/_server/package.json b/packages/_server/package.json index 234b3357ee..302a9f6a8c 100644 --- a/packages/_server/package.json +++ b/packages/_server/package.json @@ -35,13 +35,14 @@ "yargs": "^17.7.2" }, "dependencies": { - "@cspell/cspell-bundled-dicts": "^8.1.0", - "@cspell/cspell-pipe": "^8.1.0", - "@cspell/cspell-types": "^8.1.0", + "@cspell/cspell-bundled-dicts": "^8.1.2", + "@cspell/cspell-pipe": "^8.1.2", + "@cspell/cspell-types": "^8.1.2", "@internal/common-utils": "file:../__utils", - "cspell-gitignore": "^8.1.0", - "cspell-glob": "^8.1.0", - "cspell-lib": "^8.1.0", + "cspell-config-lib": "^8.1.2", + "cspell-gitignore": "^8.1.2", + "cspell-glob": "^8.1.2", + "cspell-lib": "^8.1.2", "gensequence": "^6.0.0", "json-rpc-api": "file:../json-rpc-api", "node-watch": "^0.7.4", diff --git a/packages/_server/spell-checker-config.schema.json b/packages/_server/spell-checker-config.schema.json index 0a56a791a9..2a2c1f00c4 100644 --- a/packages/_server/spell-checker-config.schema.json +++ b/packages/_server/spell-checker-config.schema.json @@ -958,6 +958,14 @@ "markdownDescription": "Defines a list of patterns that can be used with the `#cSpell.ignoreRegExpList#` and\n`#cSpell.includeRegExpList#` options.\n\n**Example:**\n\n```jsonc\n\"cSpell.patterns\": [\n {\n \"name\": \"comment-single-line\",\n \"pattern\": \"/#.*​/g\"\n },\n {\n \"name\": \"comment-multi-line\",\n \"pattern\": \"/(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)/g\"\n }\n]\n```", "scope": "resource", "type": "array" + }, + "cSpell.useLocallyInstalledCSpellDictionaries": { + "default": true, + "description": "Search for `@cspell/cspell-bundled-dicts` in the workspace folder and use it if found.", + "markdownDescription": "Search for `@cspell/cspell-bundled-dicts` in the workspace folder and use it if found.", + "scope": "resource", + "type": "boolean", + "version": "4.0.0" } }, "title": "CSpell", @@ -2664,8 +2672,8 @@ }, "cSpell.checkLimit": { "default": 500, - "description": "The limit in K-Characters to be checked in a file.", - "markdownDescription": "The limit in K-Characters to be checked in a file.", + "description": "Set the maximum number of bocks of text to check. Each block is 1024 characters.", + "markdownDescription": "Set the maximum number of bocks of text to check.\nEach block is 1024 characters.", "scope": "resource", "type": "number" }, diff --git a/packages/_server/src/codeActions.mts b/packages/_server/src/codeActions.mts index 5fbee18258..456671ba9a 100644 --- a/packages/_server/src/codeActions.mts +++ b/packages/_server/src/codeActions.mts @@ -170,7 +170,7 @@ class CodeActionHandler { // Only suggest adding if it is our diagnostic and there is a word. if (isSpellingIssue && word && spellCheckerDiags.length) { const wConfig = await pWorkspaceConfig; - const targets = calculateConfigTargets(docSetting, wConfig); + const targets = await calculateConfigTargets(docSetting, wConfig); debugTargets && logTargets(targets); if (!docSetting.hideAddToDictionaryCodeActions) { @@ -201,7 +201,7 @@ class CodeActionHandler { // Only suggest adding if it is our diagnostic and there is a word. if (word && eslintSpellCheckerDiags.length) { const wConfig = await pWorkspaceConfig; - const targets = calculateConfigTargets(docSetting, wConfig); + const targets = await calculateConfigTargets(docSetting, wConfig); debugTargets && logTargets(targets); if (!docSetting.hideAddToDictionaryCodeActions) { diff --git a/packages/_server/src/config/configTargetsHelper.mts b/packages/_server/src/config/configTargetsHelper.mts index 27d5ac2bfe..f827884822 100644 --- a/packages/_server/src/config/configTargetsHelper.mts +++ b/packages/_server/src/config/configTargetsHelper.mts @@ -1,5 +1,5 @@ import type { DictionaryDefinitionCustom } from '@cspell/cspell-types'; -import { toUri } from '@internal/common-utils/uriHelper'; +import { toFileUri, toUri } from '@internal/common-utils/uriHelper'; import { capitalize } from '@internal/common-utils/util'; import * as Path from 'path'; @@ -15,11 +15,24 @@ import type { import { ConfigKinds, ConfigScopes, weight } from './configTargets.mjs'; import type { CSpellUserSettings } from './cspellConfig/index.mjs'; import type { CSpellSettingsWithFileSource } from './documentSettings.mjs'; -import { extractCSpellFileConfigurations, extractTargetDictionaries } from './documentSettings.mjs'; - -export function calculateConfigTargets(settings: CSpellUserSettings, workspaceConfig: WorkspaceConfigForDocument): ConfigTarget[] { +import { extractCSpellFileConfigurations, extractTargetDictionaries, filterExistingCSpellFileConfigurations } from './documentSettings.mjs'; + +export async function calculateConfigTargets( + settings: CSpellUserSettings, + workspaceConfig: WorkspaceConfigForDocument, + configFilesFound?: string[], +): Promise { + const found = new Set(configFilesFound); + async function isFound(filename: string) { + if (found.has(filename)) return true; + const href = toFileUri(filename).toString(); + return found.has(href); + } const targets: ConfigTarget[] = []; - const sources = extractCSpellFileConfigurations(settings).filter((cfg) => !cfg.readonly); + const possibleSources = extractCSpellFileConfigurations(settings).filter((cfg) => !cfg.readonly); + const sources = configFilesFound + ? possibleSources.filter((cfg) => isFound(cfg.source.filename)) + : await filterExistingCSpellFileConfigurations(possibleSources); const dictionaries = extractTargetDictionaries(settings); targets.push(...workspaceConfigToTargets(workspaceConfig)); diff --git a/packages/_server/src/config/configTargetsHelper.test.mts b/packages/_server/src/config/configTargetsHelper.test.mts index fd58654e08..1605e3cf17 100644 --- a/packages/_server/src/config/configTargetsHelper.test.mts +++ b/packages/_server/src/config/configTargetsHelper.test.mts @@ -178,7 +178,7 @@ describe('Validate configTargetsHelper', () => { }; const cfg = mustBeDefined(await searchForConfig(__dirname)); const settings = { ...cfg }; - const r = calculateConfigTargets(settings, wConfig); + const r = await calculateConfigTargets(settings, wConfig); expect(r).toEqual([ oc({ kind: 'dictionary', @@ -231,7 +231,9 @@ describe('Validate configTargetsHelper', () => { const defs: DictionaryDef[] = [cd('custom-words', 'path/to/custom-words.txt', false)]; const dictionaries: string[] = (cfg.dictionaries || []).concat('custom-words'); const settings: CSpellUserSettings = { ...cfg, dictionaryDefinitions: defs, dictionaries }; - const r = calculateConfigTargets(settings, wConfig).sort((a, b) => col.compare(a.kind, b.kind) || col.compare(a.name, b.name)); + const r = (await calculateConfigTargets(settings, wConfig)).sort( + (a, b) => col.compare(a.kind, b.kind) || col.compare(a.name, b.name), + ); expect(r).toEqual([ oc({ kind: 'cspell', diff --git a/packages/_server/src/config/cspellConfig/SpellCheckerSettings.mts b/packages/_server/src/config/cspellConfig/SpellCheckerSettings.mts index 1295e1a106..973cc94574 100644 --- a/packages/_server/src/config/cspellConfig/SpellCheckerSettings.mts +++ b/packages/_server/src/config/cspellConfig/SpellCheckerSettings.mts @@ -19,7 +19,8 @@ export interface SpellCheckerSettings extends SpellCheckerShouldCheckDocSettings autoFormatConfigFile?: boolean; /** - * The limit in K-Characters to be checked in a file. + * Set the maximum number of bocks of text to check. + * Each block is 1024 characters. * @scope resource * @default 500 */ @@ -404,6 +405,14 @@ export interface SpellCheckerSettings extends SpellCheckerShouldCheckDocSettings * } */ mergeCSpellSettingsFields?: CSpellMergeFields; + + /** + * Search for `@cspell/cspell-bundled-dicts` in the workspace folder and use it if found. + * @scope resource + * @version 4.0.0 + * @default true + */ + useLocallyInstalledCSpellDictionaries?: boolean; } type AutoOrBoolean = boolean | 'auto'; diff --git a/packages/_server/src/config/documentSettings.mts b/packages/_server/src/config/documentSettings.mts index e0c7b44f78..94621abd64 100644 --- a/packages/_server/src/config/documentSettings.mts +++ b/packages/_server/src/config/documentSettings.mts @@ -1,3 +1,5 @@ +import { stat } from 'node:fs/promises'; + import { opConcatMap, opFilter, pipe } from '@cspell/cspell-pipe/sync'; import type { CSpellSettingsWithSourceTrace, @@ -23,14 +25,14 @@ import { calcOverrideSettings, clearCachedFiles, ExclusionHelper, + getDefaultConfigLoader, getSources, mergeSettings, - readSettings as cspellReadSettingsFile, searchForConfig, } from 'cspell-lib'; -import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; +import { pathToFileURL } from 'url'; import type { Connection, WorkspaceFolder } from 'vscode-languageserver/node.js'; import { URI as Uri, Utils as UriUtils } from 'vscode-uri'; @@ -106,6 +108,9 @@ const defaultCheckOnlyEnabledFileTypes = true; type ClearFn = () => void; +const fileConfigsToImport = '.vscode.configs.to.import.cspell.config.json'; +const fileVSCodeSettings = '.vscode.folder.settings.json'; + export class DocumentSettings { // Cache per folder settings private valuesToClearOnReset: ClearFn[] = []; @@ -213,7 +218,13 @@ export class DocumentSettings { private async _importSettings() { log('importSettings'); const importPaths = [...this.configsToImport].sort(); - return readAndMergeSettingsFiles(importPaths); + const loader = getDefaultConfigLoader(); + const cfg = loader.createCSpellConfigFile(pathToFileURL(fileConfigsToImport), { + name: 'VS Code Imports', + import: importPaths, + readonly: true, + }); + return await loader.mergeConfigFileWithImports(cfg); } private async _fetchWorkspaceConfiguration(uri: DocumentUri): Promise { @@ -290,7 +301,9 @@ export class DocumentSettings { const uri = typeof docUri === 'string' ? Uri.parse(docUri) : docUri; const docUriAsString = uri.toString(); const settings = await this.fetchSettingsForUri(docUriAsString); - return this.extractCSpellConfigurationFiles(settings.settings); + const uris = this.extractCSpellConfigurationFiles(settings.settings); + const found = await Promise.all(uris.map(filterUrl)); + return found.filter(isDefined); } /** @@ -316,9 +329,19 @@ export class DocumentSettings { const cSpellConfigSettings: CSpellUserSettings = { ...cSpell, id: 'VSCode-Config', + name: 'VS Code Settings', ignorePaths: ignorePaths.concat(ExclusionHelper.extractGlobsFromExcludeFilesGlobMap(exclude)), + readonly: true, }; + if (cSpellConfigSettings.useLocallyInstalledCSpellDictionaries) { + const rawImports = cSpellConfigSettings.import || []; + const imports = Array.isArray(rawImports) ? rawImports : [rawImports]; + imports.push('@cspell/cspell-bundled-dicts'); + console.error('fetchSettingsFromVSCode %o', { imports }); + cSpellConfigSettings.import = imports; + } + return cSpellConfigSettings; } @@ -329,16 +352,19 @@ export class DocumentSettings { if (uriSpecial && uri !== uriSpecial) { return this.fetchSettingsForUri(uriSpecial.toString()); } + const loader = getDefaultConfigLoader(); const folders = await this.folders; const useUriForConfig = docUri || folders[0]?.uri || defaultRootUri; + const useURLForConfig = new URL(fileVSCodeSettings, useUriForConfig); const searchForUri = Uri.parse(useUriForConfig); const searchForFsPath = path.normalize(searchForUri.fsPath); const vscodeCSpellConfigSettingsRel = await this.fetchSettingsFromVSCode(docUri); const vscodeCSpellConfigSettingsForDocument = await this.resolveWorkspacePaths(vscodeCSpellConfigSettingsRel, useUriForConfig); + const vscodeCSpellConfigFileForDocument = loader.createCSpellConfigFile(useURLForConfig, vscodeCSpellConfigSettingsForDocument); + const vscodeCSpellSettings: CSpellUserSettings = await loader.mergeConfigFileWithImports(vscodeCSpellConfigFileForDocument); const settings = vscodeCSpellConfigSettingsForDocument.noConfigSearch ? undefined : await searchForConfig(searchForFsPath); const rootFolder = this.rootSchemaAndDomainFolderForUri(docUri); const folder = await this.findMatchingFolder(docUri, folders[0] || rootFolder); - const vscodeCSpellSettings = await resolveConfigImports(vscodeCSpellConfigSettingsForDocument, folder.uri); const globRootFolder = folder !== rootFolder ? folder : folders[0] || folder; const mergedSettingsFromVSCode = mergeSettings(await this.importedSettings(), vscodeCSpellSettings); @@ -407,40 +433,6 @@ export class DocumentSettings { } } -async function resolveConfigImports(config: CSpellUserSettings, folderUri: string): Promise { - log('resolveConfigImports:', folderUri); - const uriFsPath = path.normalize(Uri.parse(folderUri).fsPath); - const imports = typeof config.import === 'string' ? [config.import] : config.import || []; - const importAbsPath = imports.map((file) => resolvePath(uriFsPath, file)); - log(`resolvingConfigImports: [\n${imports.join('\n')}]`); - log(`resolvingConfigImports ABS: [\n${importAbsPath.join('\n')}]`); - const { import: _import, ...result } = importAbsPath.length - ? mergeSettings(await readAndMergeSettingsFiles(importAbsPath), config) - : config; - return result; -} - -async function readAndMergeSettingsFiles(importAbsPaths: string[]): Promise { - return mergeSettings({}, ...(await Promise.all(readSettingsFiles([...importAbsPaths])))); -} - -function readSettingsFiles(paths: string[]) { - // log('readSettingsFiles:', paths); - const existingPaths = paths.filter((filename) => exists(filename)); - log('readSettingsFiles:', existingPaths); - // console.error('readSettingsFiles: %o', existingPaths); - return existingPaths.map((file) => cspellReadSettingsFile(file)); -} - -function exists(file: string): boolean { - try { - const s = fs.statSync(file); - return s.isFile(); - } catch (e) { - return false; - } -} - function resolvePath(...parts: string[]): string { const normalizedParts = parts.map((part) => (part[0] === '~' ? os.homedir() + part.slice(1) : part)); return path.resolve(...normalizedParts); @@ -662,11 +654,26 @@ export function extractCSpellFileConfigurations(settings: CSpellUserSettings): C .filter(isCSpellSettingsWithFileSource) .filter(({ source }) => !regExIsOwnedByCspell.test(source.filename)) .filter(({ source }) => !regExIsOwnedByExtension.test(source.filename)) + .filter(({ source }) => !source.filename.endsWith(fileConfigsToImport)) + .filter(({ source }) => !source.filename.endsWith(fileVSCodeSettings)) .reverse(); return configs; } +export async function filterExistingCSpellFileConfigurations( + configs: CSpellSettingsWithFileSource[], +): Promise { + const existingConfigs = await Promise.all( + configs.map(async (cfg) => { + const { source } = cfg; + const found = await filterUrl(toFileUri(source.filename)); + return found ? cfg : undefined; + }), + ); + return existingConfigs.filter(isDefined); +} + /** * * @param settings - finalized settings @@ -721,9 +728,25 @@ export function isExcluded(settings: ExtSettings, uri: Uri): boolean { return settings.excludeGlobMatcher.match(uri.fsPath); } +async function filterUrl(uri: Uri): Promise { + if (uri.scheme !== 'file') return undefined; + const url = new URL(uri.toString()); + try { + const stats = await stat(url); + const found = stats.isFile() ? uri : undefined; + console.error('filterUrl %o', { uri: uri.toString(), found: !!found }); + return found; + } catch (e) { + console.error('filterUrl Not found', uri.toString()); + return undefined; + } +} + export const __testing__ = { extractTargetDictionaries, extractEnableFiletypes, normalizeEnableFiletypes, applyEnableFiletypes, + fileConfigsToImport, + fileVSCodeSettings, }; diff --git a/packages/_server/src/config/documentSettings.test.mts b/packages/_server/src/config/documentSettings.test.mts index faa799face..d652fb287b 100644 --- a/packages/_server/src/config/documentSettings.test.mts +++ b/packages/_server/src/config/documentSettings.test.mts @@ -55,6 +55,7 @@ const cspellConfigInVsCode: CSpellUserSettings = { ], enabledLanguageIds: ['typescript', 'javascript', 'php', 'json', 'jsonc'], mergeCSpellSettings: true, + useLocallyInstalledCSpellDictionaries: true, }; const sampleFiles = { @@ -409,11 +410,15 @@ describe('Validate DocumentSettings', () => { expect(result.map((f) => f.toString().toLowerCase())).toEqual(expected.map((u) => filePathToUri(u).toString().toLowerCase())); }); + function rPathWsRoot(...paths: string[]) { + return Path.resolve(pathWorkspaceRoot, ...paths); + } + test.each` filename | expected ${sampleFiles.sampleClientEsLint} | ${[configFiles.clientConfig, configFiles.rootConfigYaml]} ${sampleFiles.sampleNodePackage} | ${[configFiles.rootConfigJson, configFiles.rootConfigYaml]} - ${sampleFiles.sampleSamplesReadme} | ${[Path.resolve(pathWorkspaceRoot, 'samples/custom-dictionary/cspell.json')]} + ${sampleFiles.sampleSamplesReadme} | ${[rPathWsRoot('samples/custom-dictionary/cspell.json')]} ${sampleFiles.sampleClientReadme} | ${[configFiles.clientConfig, configFiles.rootConfigYaml]} ${sampleFiles.sampleServerPackageLock} | ${[configFiles.serverConfig, configFiles.rootConfigYaml]} `('findCSpellConfigurationFilesForUri no folders $filename', async ({ filename, expected }: FindCSpellConfigurationFilesForUriTest) => { diff --git a/packages/_server/src/server.mts b/packages/_server/src/server.mts index a4efb70c10..53d1eec559 100644 --- a/packages/_server/src/server.mts +++ b/packages/_server/src/server.mts @@ -378,7 +378,7 @@ export function run(): void { const activeSettings = await getActiveUriSettings(uri); const settings = stringifyPatterns(activeSettings); const configFiles = uri ? (await documentSettings.findCSpellConfigurationFilesForUri(uri)).map((uri) => uri.toString()) : []; - const configTargets = workspaceConfig ? calculateConfigTargets(settings, workspaceConfig) : []; + const configTargets = workspaceConfig ? await calculateConfigTargets(settings, workspaceConfig, configFiles) : []; const ieInfo = await calcIncludeExcludeInfo(activeSettings, params); return { diff --git a/packages/_serverPatternMatcher/package.json b/packages/_serverPatternMatcher/package.json index 6d5d5943c0..3815d31b85 100644 --- a/packages/_serverPatternMatcher/package.json +++ b/packages/_serverPatternMatcher/package.json @@ -47,9 +47,9 @@ "webpack-cli": "^5.1.4" }, "dependencies": { - "@cspell/cspell-types": "^8.1.0", + "@cspell/cspell-types": "^8.1.2", "@internal/common-utils": "file:../__utils", - "cspell-lib": "^8.1.0", + "cspell-lib": "^8.1.2", "regexp-worker": "^2.0.2", "vscode-languageserver-textdocument": "^1.0.11", "vscode-languageserver": "^9.0.1", diff --git a/packages/_settingsViewer/package.json b/packages/_settingsViewer/package.json index f672b00873..c572577836 100644 --- a/packages/_settingsViewer/package.json +++ b/packages/_settingsViewer/package.json @@ -38,7 +38,7 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "react-test-renderer": "^17.0.2", - "terser": "^5.24.0", + "terser": "^5.25.0", "terser-webpack-plugin": "^5.3.9", "ts-loader": "^9.5.1", "vscode-uri": "^3.0.8", diff --git a/packages/client/package.json b/packages/client/package.json index 7ebc2c4694..d0cfeb72db 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -45,7 +45,7 @@ "@types/kefir": "^3.8.11", "@types/source-map-support": "^0.5.10", "cross-env": "^7.0.3", - "cspell-lib": "^8.1.0", + "cspell-lib": "^8.1.2", "lorem-ipsum": "^2.0.8", "rfdc": "^1.3.0", "source-map-support": "^0.5.21", @@ -55,7 +55,7 @@ "webpack-cli": "^5.1.4" }, "dependencies": { - "@cspell/cspell-types": "^8.1.0", + "@cspell/cspell-types": "^8.1.2", "@internal/common-utils": "file:../__utils", "@internal/settings-webview": "file:../_settingsViewer", "code-spell-checker-server": "file:../_server", diff --git a/packages/client/src/client/client.ts b/packages/client/src/client/client.ts index ac3da79102..7e6d4fd127 100644 --- a/packages/client/src/client/client.ts +++ b/packages/client/src/client/client.ts @@ -141,7 +141,7 @@ export class CSpellClient implements Disposable { const { uri, languageId } = document || {}; const workspaceConfig = calculateWorkspaceConfigForDocument(uri); - if (!uri) { + if (!uri || !workspaceConfig.uri) { return this.serverApi.getConfigurationForDocument({ workspaceConfig }); } return this.serverApi.getConfigurationForDocument({ uri: uri.toString(), languageId, workspaceConfig }); @@ -289,7 +289,7 @@ function calculateWorkspaceConfigForDocument(docUri: Uri | undefined): Workspace tWords.user = tUserWords.user; const resp: WorkspaceConfigForDocumentResponse = { - uri: docUri?.toString(), + uri: scope?.toString(), workspaceFile, workspaceFolder, words: tWords, diff --git a/packages/client/src/settings/configFields.ts b/packages/client/src/settings/configFields.ts index 589003993c..644070b5e4 100644 --- a/packages/client/src/settings/configFields.ts +++ b/packages/client/src/settings/configFields.ts @@ -49,6 +49,7 @@ export const ConfigFields: CSpellUserSettingsFields = { suggestionMenuType: 'suggestionMenuType', suggestionNumChanges: 'suggestionNumChanges', suggestionsTimeout: 'suggestionsTimeout', + useLocallyInstalledCSpellDictionaries: 'useLocallyInstalledCSpellDictionaries', workspaceRootPath: 'workspaceRootPath', decorateIssues: 'decorateIssues', textDecoration: 'textDecoration',