cspell-lib 5.12.5 → 5.13.2
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
CHANGED
|
@@ -22,6 +22,7 @@ exports.languageExtensionDefinitions = [
|
|
|
22
22
|
},
|
|
23
23
|
{ id: 'csharp', extensions: ['.cs'] },
|
|
24
24
|
{ id: 'css', extensions: ['.css'] },
|
|
25
|
+
{ id: 'dhall', extensions: ['.dhall'] },
|
|
25
26
|
{ id: 'diff', extensions: ['.diff', '.patch', '.rej'] },
|
|
26
27
|
{ id: 'dockerfile', extensions: ['.dockerfile'] },
|
|
27
28
|
{ id: 'elixir', extensions: ['.ex', '.exs'] },
|
|
@@ -58,6 +59,7 @@ exports.languageExtensionDefinitions = [
|
|
|
58
59
|
{ id: 'php', extensions: ['.php', '.php4', '.php5', '.phtml', '.ctp'] },
|
|
59
60
|
{ id: 'plaintext', extensions: ['.txt'] },
|
|
60
61
|
{ id: 'powershell', extensions: ['.ps1', '.psm1', '.psd1', '.pssc', '.psrc'] },
|
|
62
|
+
{ id: 'purescript', extensions: ['.purs'] },
|
|
61
63
|
{ id: 'python', extensions: ['.py', '.rpy', '.pyw', '.cpy', '.gyp', '.gypi'] },
|
|
62
64
|
{ id: 'r', extensions: ['.r', '.rhistory', '.rprofile', '.rt'] },
|
|
63
65
|
{ id: 'razor', extensions: ['.cshtml'] },
|
|
@@ -92,7 +94,7 @@ exports.languageExtensionDefinitions = [
|
|
|
92
94
|
{ id: 'sql', extensions: ['.sql', '.dsql'] },
|
|
93
95
|
{ id: 'swift', extensions: ['.swift'] },
|
|
94
96
|
{ id: 'toml', extensions: ['.toml'] },
|
|
95
|
-
{ id: 'typescript', extensions: ['.ts'] },
|
|
97
|
+
{ id: 'typescript', extensions: ['.ts', '.cts', '.mts'] },
|
|
96
98
|
{ id: 'typescriptreact', extensions: ['.tsx'] },
|
|
97
99
|
{ id: 'vb', extensions: ['.vb', '.brs', '.vbs', '.bas'] },
|
|
98
100
|
{ id: 'vue', extensions: ['.vue'] },
|
|
@@ -25,7 +25,7 @@ export declare function readRawSettings(filename: string, relativeTo?: string):
|
|
|
25
25
|
*
|
|
26
26
|
* @param filenames - settings files to read
|
|
27
27
|
* @returns combined configuration
|
|
28
|
-
* @deprecated
|
|
28
|
+
* @deprecated true
|
|
29
29
|
*/
|
|
30
30
|
export declare function readSettingsFiles(filenames: string[]): CSpellSettings;
|
|
31
31
|
export declare function mergeSettings(left: CSpellSettings, ...settings: CSpellSettings[]): CSpellSettings;
|
|
@@ -290,7 +290,7 @@ exports.readRawSettings = readRawSettings;
|
|
|
290
290
|
*
|
|
291
291
|
* @param filenames - settings files to read
|
|
292
292
|
* @returns combined configuration
|
|
293
|
-
* @deprecated
|
|
293
|
+
* @deprecated true
|
|
294
294
|
*/
|
|
295
295
|
function readSettingsFiles(filenames) {
|
|
296
296
|
return filenames.map((filename) => readSettings(filename)).reduce((a, b) => mergeSettings(a, b), defaultSettings);
|
|
@@ -40,6 +40,7 @@ function parseSettingMatch(matchArray) {
|
|
|
40
40
|
const possibleSetting = match.trim();
|
|
41
41
|
const settingParsers = [
|
|
42
42
|
[/^(?:enable|disable)(?:allow)?CompoundWords/i, parseCompoundWords],
|
|
43
|
+
[/^(?:enable|disable)CaseSensitive/i, parseCaseSensitive],
|
|
43
44
|
[/^words?\s/i, parseWords],
|
|
44
45
|
[/^ignore(?:words?)?\s/i, parseIgnoreWords],
|
|
45
46
|
[/^ignore_?Reg_?Exp\s+.+$/i, parseIgnoreRegExp],
|
|
@@ -58,6 +59,10 @@ function parseCompoundWords(match) {
|
|
|
58
59
|
const allowCompoundWords = /enable/i.test(match);
|
|
59
60
|
return { id: 'in-doc-allowCompoundWords', allowCompoundWords };
|
|
60
61
|
}
|
|
62
|
+
function parseCaseSensitive(match) {
|
|
63
|
+
const caseSensitive = /enable/i.test(match);
|
|
64
|
+
return { id: 'in-doc-caseSensitive', caseSensitive };
|
|
65
|
+
}
|
|
61
66
|
function parseWords(match) {
|
|
62
67
|
const words = match.split(/[,\s]+/g).slice(1);
|
|
63
68
|
return { id: 'in-doc-words', words };
|
package/dist/textValidator.js
CHANGED
|
@@ -81,10 +81,13 @@ function lineValidator(dict, options) {
|
|
|
81
81
|
function isWordIgnored(word) {
|
|
82
82
|
return dict.isNoSuggestWord(word, options);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function isWordFlagged(word) {
|
|
85
85
|
const isIgnored = isWordIgnored(word.text);
|
|
86
86
|
const isFlagged = !isIgnored && testForFlaggedWord(word);
|
|
87
|
-
|
|
87
|
+
return isFlagged;
|
|
88
|
+
}
|
|
89
|
+
function checkFlagWords(word) {
|
|
90
|
+
word.isFlagged = isWordFlagged(word);
|
|
88
91
|
return word;
|
|
89
92
|
}
|
|
90
93
|
function checkWord(word, options) {
|
|
@@ -123,6 +126,14 @@ function lineValidator(dict, options) {
|
|
|
123
126
|
return codeWordResults;
|
|
124
127
|
}
|
|
125
128
|
function checkPossibleWords(possibleWord) {
|
|
129
|
+
if (isWordFlagged(possibleWord)) {
|
|
130
|
+
const vr = {
|
|
131
|
+
...possibleWord,
|
|
132
|
+
line: lineSegment,
|
|
133
|
+
isFlagged: true,
|
|
134
|
+
};
|
|
135
|
+
return [vr];
|
|
136
|
+
}
|
|
126
137
|
const mismatches = Text.extractWordsFromTextOffset(possibleWord)
|
|
127
138
|
.filter(filterAlreadyChecked)
|
|
128
139
|
.map((wo) => ({ ...wo, line: lineSegment }))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell-lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.2",
|
|
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",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/streetsidesoftware/cspell#readme",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@cspell/cspell-bundled-dicts": "^5.
|
|
51
|
-
"@cspell/cspell-types": "^5.
|
|
52
|
-
"clear-module": "^4.1.
|
|
50
|
+
"@cspell/cspell-bundled-dicts": "^5.13.2",
|
|
51
|
+
"@cspell/cspell-types": "^5.13.2",
|
|
52
|
+
"clear-module": "^4.1.2",
|
|
53
53
|
"comment-json": "^4.1.1",
|
|
54
54
|
"configstore": "^5.0.1",
|
|
55
55
|
"cosmiconfig": "^7.0.1",
|
|
56
|
-
"cspell-glob": "^5.
|
|
57
|
-
"cspell-io": "^5.
|
|
58
|
-
"cspell-trie-lib": "^5.
|
|
56
|
+
"cspell-glob": "^5.13.2",
|
|
57
|
+
"cspell-io": "^5.13.2",
|
|
58
|
+
"cspell-trie-lib": "^5.13.2",
|
|
59
59
|
"find-up": "^5.0.0",
|
|
60
60
|
"fs-extra": "^10.0.0",
|
|
61
61
|
"gensequence": "^3.1.1",
|
|
@@ -74,17 +74,17 @@
|
|
|
74
74
|
"@cspell/dict-fa-ir": "^1.0.17",
|
|
75
75
|
"@cspell/dict-fr-fr": "^2.0.1",
|
|
76
76
|
"@cspell/dict-html": "^1.1.9",
|
|
77
|
-
"@cspell/dict-nl-nl": "^2.
|
|
78
|
-
"@cspell/dict-python": "^2.0.
|
|
77
|
+
"@cspell/dict-nl-nl": "^2.1.1",
|
|
78
|
+
"@cspell/dict-python": "^2.0.5",
|
|
79
79
|
"@types/configstore": "^5.0.1",
|
|
80
80
|
"@types/fs-extra": "^9.0.13",
|
|
81
|
-
"@types/jest": "^27.0.
|
|
82
|
-
"@types/node": "^16.11.
|
|
81
|
+
"@types/jest": "^27.0.3",
|
|
82
|
+
"@types/node": "^16.11.10",
|
|
83
83
|
"cspell-dict-nl-nl": "^1.1.2",
|
|
84
|
-
"jest": "^27.
|
|
84
|
+
"jest": "^27.4.0",
|
|
85
85
|
"lorem-ipsum": "^2.0.4",
|
|
86
86
|
"rimraf": "^3.0.2",
|
|
87
87
|
"ts-jest": "^27.0.7"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "98bce0c75dcf4328b0adc80a9014809b393c0d37"
|
|
90
90
|
}
|