cspell-lib 6.9.0 → 6.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LanguageIds.js +13 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/package.json +11 -11
package/dist/LanguageIds.js
CHANGED
|
@@ -175,7 +175,10 @@ exports.languageExtensionDefinitions = [
|
|
|
175
175
|
//
|
|
176
176
|
// Special file types used to prevent spell checking.
|
|
177
177
|
//
|
|
178
|
-
{
|
|
178
|
+
{
|
|
179
|
+
id: 'image',
|
|
180
|
+
extensions: ['.jpg', '.png', '.jpeg', '.tiff', '.bmp', '.gif', '.ico'],
|
|
181
|
+
},
|
|
179
182
|
// cspell:ignore woff
|
|
180
183
|
{
|
|
181
184
|
id: 'binary',
|
|
@@ -263,11 +266,14 @@ exports.buildLanguageExtensionMapSet = buildLanguageExtensionMapSet;
|
|
|
263
266
|
function buildExtensionToLanguageIdMap(map) {
|
|
264
267
|
return new Map([...map].map(([k, s]) => [k, [...s]]));
|
|
265
268
|
}
|
|
269
|
+
function _getLanguagesForExt(ext) {
|
|
270
|
+
return mapExtensionToLanguageIds.get(ext) || mapExtensionToLanguageIds.get('.' + ext);
|
|
271
|
+
}
|
|
266
272
|
function getLanguagesForExt(ext) {
|
|
267
|
-
return
|
|
273
|
+
return _getLanguagesForExt(ext) || _getLanguagesForExt(ext.toLowerCase()) || [];
|
|
268
274
|
}
|
|
269
275
|
exports.getLanguagesForExt = getLanguagesForExt;
|
|
270
|
-
function
|
|
276
|
+
function _getLanguagesForBasename(basename) {
|
|
271
277
|
const found = mapExtensionToLanguageIds.get(basename);
|
|
272
278
|
if (found)
|
|
273
279
|
return found;
|
|
@@ -276,7 +282,10 @@ function getLanguagesForBasename(basename) {
|
|
|
276
282
|
if (ids)
|
|
277
283
|
return ids;
|
|
278
284
|
}
|
|
279
|
-
return
|
|
285
|
+
return undefined;
|
|
286
|
+
}
|
|
287
|
+
function getLanguagesForBasename(basename) {
|
|
288
|
+
return _getLanguagesForBasename(basename) || _getLanguagesForBasename(basename.toLowerCase()) || [];
|
|
280
289
|
}
|
|
281
290
|
exports.getLanguagesForBasename = getLanguagesForBasename;
|
|
282
291
|
//# sourceMappingURL=LanguageIds.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import * as Text from './util/text';
|
|
|
6
6
|
export * from '@cspell/cspell-types';
|
|
7
7
|
export { asyncIterableToArray, readFile, readFileSync, writeToFile, writeToFileIterable, writeToFileIterableP, } from 'cspell-io';
|
|
8
8
|
export { ExcludeFilesGlobMap, ExclusionFunction } from './exclusionHelper';
|
|
9
|
-
export { getLanguagesForExt } from './LanguageIds';
|
|
9
|
+
export { getLanguagesForExt, getLanguagesForBasename as getLanguageIdsForBaseFilename } from './LanguageIds';
|
|
10
10
|
export { createTextDocument, updateTextDocument } from './Models/TextDocument';
|
|
11
11
|
export type { CreateTextDocumentParams, TextDocument, TextDocumentLine } from './Models/TextDocument';
|
|
12
12
|
export * from './Settings';
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getDictionary = exports.clearCachedFiles = exports.ExclusionHelper = exports.Link = exports.Text = exports.validateText = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = exports.resolveFile = exports.setLogger = exports.getLogger = exports.traceWordsAsync = exports.traceWords = exports.DocumentValidator = exports.suggestionsForWords = exports.suggestionsForWord = exports.SuggestionError = exports.SpellingDictionaryLoadError = exports.SpellingDictionaryCollection = exports.refreshDictionaryCache = exports.isSpellingDictionaryLoadError = exports.createSpellingDictionary = exports.CompoundWordsMethod = exports.spellCheckFile = exports.spellCheckDocument = exports.isBinaryFile = exports.fileToTextDocument = exports.fileToDocument = exports.determineFinalDocumentSettings = exports.constructSettingsForText = exports.combineTextAndLanguageSettings = exports.defaultSettingsFilename = exports.updateTextDocument = exports.createTextDocument = exports.getLanguagesForExt = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = exports.asyncIterableToArray = void 0;
|
|
29
|
+
exports.getDictionary = exports.clearCachedFiles = exports.ExclusionHelper = exports.Link = exports.Text = exports.validateText = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = exports.resolveFile = exports.setLogger = exports.getLogger = exports.traceWordsAsync = exports.traceWords = exports.DocumentValidator = exports.suggestionsForWords = exports.suggestionsForWord = exports.SuggestionError = exports.SpellingDictionaryLoadError = exports.SpellingDictionaryCollection = exports.refreshDictionaryCache = exports.isSpellingDictionaryLoadError = exports.createSpellingDictionary = exports.CompoundWordsMethod = exports.spellCheckFile = exports.spellCheckDocument = exports.isBinaryFile = exports.fileToTextDocument = exports.fileToDocument = exports.determineFinalDocumentSettings = exports.constructSettingsForText = exports.combineTextAndLanguageSettings = exports.defaultSettingsFilename = exports.updateTextDocument = exports.createTextDocument = exports.getLanguageIdsForBaseFilename = exports.getLanguagesForExt = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = exports.asyncIterableToArray = void 0;
|
|
30
30
|
const ExclusionHelper = __importStar(require("./exclusionHelper"));
|
|
31
31
|
exports.ExclusionHelper = ExclusionHelper;
|
|
32
32
|
const Settings_1 = require("./Settings");
|
|
@@ -46,6 +46,7 @@ Object.defineProperty(exports, "writeToFileIterable", { enumerable: true, get: f
|
|
|
46
46
|
Object.defineProperty(exports, "writeToFileIterableP", { enumerable: true, get: function () { return cspell_io_1.writeToFileIterableP; } });
|
|
47
47
|
var LanguageIds_1 = require("./LanguageIds");
|
|
48
48
|
Object.defineProperty(exports, "getLanguagesForExt", { enumerable: true, get: function () { return LanguageIds_1.getLanguagesForExt; } });
|
|
49
|
+
Object.defineProperty(exports, "getLanguageIdsForBaseFilename", { enumerable: true, get: function () { return LanguageIds_1.getLanguagesForBasename; } });
|
|
49
50
|
var TextDocument_1 = require("./Models/TextDocument");
|
|
50
51
|
Object.defineProperty(exports, "createTextDocument", { enumerable: true, get: function () { return TextDocument_1.createTextDocument; } });
|
|
51
52
|
Object.defineProperty(exports, "updateTextDocument", { enumerable: true, get: function () { return TextDocument_1.updateTextDocument; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell-lib",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.1",
|
|
4
4
|
"description": "A library of useful functions used across various cspell tools.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://github.com/streetsidesoftware/cspell#readme",
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@cspell/cspell-bundled-dicts": "^6.9.
|
|
52
|
-
"@cspell/cspell-pipe": "^6.9.
|
|
53
|
-
"@cspell/cspell-types": "^6.9.
|
|
51
|
+
"@cspell/cspell-bundled-dicts": "^6.9.1",
|
|
52
|
+
"@cspell/cspell-pipe": "^6.9.1",
|
|
53
|
+
"@cspell/cspell-types": "^6.9.1",
|
|
54
54
|
"clear-module": "^4.1.2",
|
|
55
55
|
"comment-json": "^4.2.3",
|
|
56
56
|
"configstore": "^5.0.1",
|
|
57
57
|
"cosmiconfig": "^7.0.1",
|
|
58
|
-
"cspell-glob": "^6.9.
|
|
59
|
-
"cspell-grammar": "^6.9.
|
|
60
|
-
"cspell-io": "^6.9.
|
|
61
|
-
"cspell-trie-lib": "^6.9.
|
|
58
|
+
"cspell-glob": "^6.9.1",
|
|
59
|
+
"cspell-grammar": "^6.9.1",
|
|
60
|
+
"cspell-io": "^6.9.1",
|
|
61
|
+
"cspell-trie-lib": "^6.9.1",
|
|
62
62
|
"fast-equals": "^4.0.3",
|
|
63
63
|
"find-up": "^5.0.0",
|
|
64
64
|
"fs-extra": "^10.1.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"resolve-from": "^5.0.0",
|
|
68
68
|
"resolve-global": "^1.0.0",
|
|
69
69
|
"vscode-languageserver-textdocument": "^1.0.7",
|
|
70
|
-
"vscode-uri": "
|
|
70
|
+
"vscode-uri": "3.0.4"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
|
73
73
|
"node": ">=14"
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@cspell/dict-python": "^2.0.6",
|
|
84
84
|
"@types/configstore": "^5.0.1",
|
|
85
85
|
"@types/fs-extra": "^9.0.13",
|
|
86
|
-
"@types/jest": "^29.0.
|
|
86
|
+
"@types/jest": "^29.0.3",
|
|
87
87
|
"@types/node": "^18.7.18",
|
|
88
88
|
"cspell-dict-nl-nl": "^1.1.2",
|
|
89
89
|
"jest": "^29.0.3",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"rollup-plugin-dts": "^4.2.2",
|
|
94
94
|
"ts-jest": "^29.0.1"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "e405a2b1dec307888369cd7aafd58c1b3908d97c"
|
|
97
97
|
}
|