@cspell/cspell-types 5.12.0 → 5.12.4
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/cspell.schema.json +24 -0
- package/dist/CSpellReporter.d.ts +1 -0
- package/dist/CSpellSettingsDef.d.ts +10 -0
- package/dist/settings/CSpellSettingsDef.d.ts +589 -0
- package/dist/settings/CSpellSettingsDef.js +3 -0
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/index.js +14 -0
- package/package.json +7 -7
package/cspell.schema.json
CHANGED
|
@@ -55,6 +55,11 @@
|
|
|
55
55
|
"$ref": "#/definitions/ReplaceMap",
|
|
56
56
|
"description": "Replacement pairs"
|
|
57
57
|
},
|
|
58
|
+
"type": {
|
|
59
|
+
"$ref": "#/definitions/DictionaryFileTypes",
|
|
60
|
+
"default": "S",
|
|
61
|
+
"description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed) Default is S C is the slowest to load due to the need to split each line based upon code splitting rules."
|
|
62
|
+
},
|
|
58
63
|
"useCompounds": {
|
|
59
64
|
"description": "Use Compounds",
|
|
60
65
|
"type": "boolean"
|
|
@@ -108,6 +113,11 @@
|
|
|
108
113
|
],
|
|
109
114
|
"description": "Defines the scope for when words will be added to the dictionary. Scope values: `user`, `workspace`, `folder`"
|
|
110
115
|
},
|
|
116
|
+
"type": {
|
|
117
|
+
"$ref": "#/definitions/DictionaryFileTypes",
|
|
118
|
+
"default": "S",
|
|
119
|
+
"description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed) Default is S C is the slowest to load due to the need to split each line based upon code splitting rules."
|
|
120
|
+
},
|
|
111
121
|
"useCompounds": {
|
|
112
122
|
"description": "Use Compounds",
|
|
113
123
|
"type": "boolean"
|
|
@@ -143,6 +153,11 @@
|
|
|
143
153
|
"$ref": "#/definitions/ReplaceMap",
|
|
144
154
|
"description": "Replacement pairs"
|
|
145
155
|
},
|
|
156
|
+
"type": {
|
|
157
|
+
"$ref": "#/definitions/DictionaryFileTypes",
|
|
158
|
+
"default": "S",
|
|
159
|
+
"description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed) Default is S C is the slowest to load due to the need to split each line based upon code splitting rules."
|
|
160
|
+
},
|
|
146
161
|
"useCompounds": {
|
|
147
162
|
"description": "Use Compounds",
|
|
148
163
|
"type": "boolean"
|
|
@@ -154,6 +169,15 @@
|
|
|
154
169
|
],
|
|
155
170
|
"type": "object"
|
|
156
171
|
},
|
|
172
|
+
"DictionaryFileTypes": {
|
|
173
|
+
"enum": [
|
|
174
|
+
"S",
|
|
175
|
+
"W",
|
|
176
|
+
"C",
|
|
177
|
+
"T"
|
|
178
|
+
],
|
|
179
|
+
"type": "string"
|
|
180
|
+
},
|
|
157
181
|
"DictionaryId": {
|
|
158
182
|
"description": "This is the name of a dictionary.\n\nName Format:\n- Must contain at least 1 number or letter.\n- spaces are allowed.\n- Leading and trailing space will be removed.\n- Names ARE case-sensitive\n- Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`",
|
|
159
183
|
"pattern": "^(?=[^!*,;{}[\\]~\\n]+$)(?=(.*\\w)).+$",
|
package/dist/CSpellReporter.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export interface ProgressFileComplete extends ProgressBase {
|
|
|
32
32
|
elapsedTimeMs: number | undefined;
|
|
33
33
|
processed: boolean | undefined;
|
|
34
34
|
numErrors: number | undefined;
|
|
35
|
+
cached?: boolean;
|
|
35
36
|
}
|
|
36
37
|
export declare type ProgressEmitter = (p: ProgressItem | ProgressFileComplete) => void;
|
|
37
38
|
export interface RunResult {
|
|
@@ -319,6 +319,16 @@ export interface DictionaryDefinitionBase {
|
|
|
319
319
|
* possible suggestions.
|
|
320
320
|
*/
|
|
321
321
|
noSuggest?: boolean;
|
|
322
|
+
/**
|
|
323
|
+
* Type of file:
|
|
324
|
+
* S - single word per line,
|
|
325
|
+
* W - each line can contain one or more words separated by space,
|
|
326
|
+
* C - each line is treated like code (Camel Case is allowed)
|
|
327
|
+
* Default is S
|
|
328
|
+
* C is the slowest to load due to the need to split each line based upon code splitting rules.
|
|
329
|
+
* @default "S"
|
|
330
|
+
*/
|
|
331
|
+
type?: DictionaryFileTypes;
|
|
322
332
|
}
|
|
323
333
|
export interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
|
|
324
334
|
/** Path to the file */
|
|
@@ -0,0 +1,589 @@
|
|
|
1
|
+
export declare type ReplaceEntry = [string, string];
|
|
2
|
+
export declare type ReplaceMap = ReplaceEntry[];
|
|
3
|
+
/**
|
|
4
|
+
* These settings come from user and workspace settings.
|
|
5
|
+
*/
|
|
6
|
+
export declare type CSpellPackageSettings = CSpellUserSettings;
|
|
7
|
+
export declare type CSpellUserSettings = CSpellSettings;
|
|
8
|
+
export interface CSpellSettings extends FileSettings, LegacySettings {
|
|
9
|
+
$schema?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ImportFileRef {
|
|
12
|
+
filename: string;
|
|
13
|
+
error?: Error;
|
|
14
|
+
referencedBy?: Source[];
|
|
15
|
+
}
|
|
16
|
+
export interface CSpellSettingsWithSourceTrace extends CSpellSettings {
|
|
17
|
+
source?: Source;
|
|
18
|
+
__importRef?: ImportFileRef;
|
|
19
|
+
__imports?: Map<string, ImportFileRef>;
|
|
20
|
+
}
|
|
21
|
+
export interface FileSettings extends ExtendableSettings {
|
|
22
|
+
/**
|
|
23
|
+
* Configuration format version of the settings file.
|
|
24
|
+
* @default "0.2"
|
|
25
|
+
*/
|
|
26
|
+
version?: Version;
|
|
27
|
+
/** Words to add to global dictionary -- should only be in the user config file. */
|
|
28
|
+
userWords?: string[];
|
|
29
|
+
/** Other settings files to be included */
|
|
30
|
+
import?: FsPath | FsPath[];
|
|
31
|
+
/**
|
|
32
|
+
* The root to use for glop patterns found in this configuration.
|
|
33
|
+
* Default: location of the configuration file.
|
|
34
|
+
* For compatibility reasons, config files with version 0.1, the glob root will
|
|
35
|
+
* default to be `${cwd}`.
|
|
36
|
+
*
|
|
37
|
+
* Use `globRoot` to define a different location.
|
|
38
|
+
* `globRoot` can be relative to the location of this configuration file.
|
|
39
|
+
* Defining globRoot, does not impact imported configurations.
|
|
40
|
+
*
|
|
41
|
+
* Special Values:
|
|
42
|
+
* - `${cwd}` - will be replaced with the current working directory.
|
|
43
|
+
* - `.` - will be the location of the containing configuration file.
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
globRoot?: FsPath;
|
|
47
|
+
/**
|
|
48
|
+
* Glob patterns of files to be checked.
|
|
49
|
+
* Glob patterns are relative to the `globRoot` of the configuration file that defines them.
|
|
50
|
+
*/
|
|
51
|
+
files?: Glob[];
|
|
52
|
+
/**
|
|
53
|
+
* Glob patterns of files to be ignored
|
|
54
|
+
* Glob patterns are relative to the `globRoot` of the configuration file that defines them.
|
|
55
|
+
*/
|
|
56
|
+
ignorePaths?: Glob[];
|
|
57
|
+
/**
|
|
58
|
+
* Prevents searching for local configuration when checking individual documents.
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
noConfigSearch?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Indicate that the configuration file should not be modified.
|
|
64
|
+
* This is used to prevent tools like the VS Code Spell Checker from
|
|
65
|
+
* modifying the file to add words and other configuration.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
readonly?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Custom reporters configuration
|
|
71
|
+
*/
|
|
72
|
+
reporters?: ReporterSettings[];
|
|
73
|
+
}
|
|
74
|
+
export interface ExtendableSettings extends Settings {
|
|
75
|
+
/** Overrides to apply based upon the file path. */
|
|
76
|
+
overrides?: OverrideSettings[];
|
|
77
|
+
}
|
|
78
|
+
export interface Settings extends ReportingConfiguration, BaseSetting, PnPSettings {
|
|
79
|
+
/**
|
|
80
|
+
* Current active spelling language.
|
|
81
|
+
*
|
|
82
|
+
* Example: "en-GB" for British English
|
|
83
|
+
*
|
|
84
|
+
* Example: "en,nl" to enable both English and Dutch
|
|
85
|
+
* @default "en"
|
|
86
|
+
*/
|
|
87
|
+
language?: LocaleId;
|
|
88
|
+
/** languageIds for the files to spell check. */
|
|
89
|
+
enabledLanguageIds?: LanguageIdSingle[];
|
|
90
|
+
/**
|
|
91
|
+
* @title File Types to Check
|
|
92
|
+
* @scope resource
|
|
93
|
+
* @uniqueItems true
|
|
94
|
+
* @markdownDescription
|
|
95
|
+
* Enable / Disable checking file types (languageIds).
|
|
96
|
+
* These are in additional to the file types specified by `cSpell.enabledLanguageIds`.
|
|
97
|
+
* To disable a language, prefix with `!` as in `!json`,
|
|
98
|
+
*
|
|
99
|
+
* Example:
|
|
100
|
+
* ```
|
|
101
|
+
* jsonc // enable checking for jsonc
|
|
102
|
+
* !json // disable checking for json
|
|
103
|
+
* kotlin // enable checking for kotlin
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
enableFiletypes?: LanguageIdSingle[];
|
|
107
|
+
/** Additional settings for individual languages. */
|
|
108
|
+
languageSettings?: LanguageSetting[];
|
|
109
|
+
/** Forces the spell checker to assume a give language id. Used mainly as an Override. */
|
|
110
|
+
languageId?: LanguageId;
|
|
111
|
+
}
|
|
112
|
+
export interface ReportingConfiguration extends SuggestionsConfiguration {
|
|
113
|
+
/**
|
|
114
|
+
* The maximum number of problems to report in a file.
|
|
115
|
+
* @default 100
|
|
116
|
+
*/
|
|
117
|
+
maxNumberOfProblems?: number;
|
|
118
|
+
/**
|
|
119
|
+
* The maximum number of times the same word can be flagged as an error in a file.
|
|
120
|
+
* @default 5
|
|
121
|
+
*/
|
|
122
|
+
maxDuplicateProblems?: number;
|
|
123
|
+
/**
|
|
124
|
+
* The minimum length of a word before checking it against a dictionary.
|
|
125
|
+
* @default 4
|
|
126
|
+
*/
|
|
127
|
+
minWordLength?: number;
|
|
128
|
+
}
|
|
129
|
+
export interface SuggestionsConfiguration {
|
|
130
|
+
/**
|
|
131
|
+
* Number of suggestions to make
|
|
132
|
+
* @default 10
|
|
133
|
+
*/
|
|
134
|
+
numSuggestions?: number;
|
|
135
|
+
/**
|
|
136
|
+
* The maximum amount of time in milliseconds to generate suggestions for a word.
|
|
137
|
+
* @default 500
|
|
138
|
+
*/
|
|
139
|
+
suggestionsTimeout?: number;
|
|
140
|
+
/**
|
|
141
|
+
* The maximum number of changes allowed on a word to be considered a suggestions.
|
|
142
|
+
*
|
|
143
|
+
* For example, appending an `s` onto `example` -> `examples` is considered 1 change.
|
|
144
|
+
*
|
|
145
|
+
* Range: between 1 and 5.
|
|
146
|
+
* @default 3
|
|
147
|
+
*/
|
|
148
|
+
suggestionNumChanges?: number;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Plug N Play settings to support package systems like Yarn 2.
|
|
152
|
+
*/
|
|
153
|
+
export interface PnPSettings {
|
|
154
|
+
/**
|
|
155
|
+
* Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading
|
|
156
|
+
* packages stored in the repository.
|
|
157
|
+
*
|
|
158
|
+
* When true, the spell checker will search up the directory structure for the existence
|
|
159
|
+
* of a PnP file and load it.
|
|
160
|
+
*
|
|
161
|
+
* @default false
|
|
162
|
+
*/
|
|
163
|
+
usePnP?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* The PnP files to search for. Note: `.mjs` files are not currently supported.
|
|
166
|
+
*
|
|
167
|
+
* @default [".pnp.js", ".pnp.cjs"]
|
|
168
|
+
*/
|
|
169
|
+
pnpFiles?: string[];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* To prevent the unwanted execution of untrusted code, WorkspaceTrustSettings
|
|
173
|
+
* are use to set the trust levels.
|
|
174
|
+
*
|
|
175
|
+
* Trust setting have an impact on both `cspell.config.js` files and on `.pnp.js` files.
|
|
176
|
+
* In an untrusted location, these files will NOT be used.
|
|
177
|
+
*
|
|
178
|
+
* This will also prevent any associated plugins from being loaded.
|
|
179
|
+
*/
|
|
180
|
+
export interface WorkspaceTrustSettings {
|
|
181
|
+
/**
|
|
182
|
+
* Glob patterns of locations that contain ALWAYS trusted files
|
|
183
|
+
*/
|
|
184
|
+
trustedFiles?: Glob[];
|
|
185
|
+
/**
|
|
186
|
+
* Glob patterns of locations that contain NEVER trusted files
|
|
187
|
+
*/
|
|
188
|
+
untrustedFiles?: Glob[];
|
|
189
|
+
/**
|
|
190
|
+
* Sets the default trust level
|
|
191
|
+
* @default "trusted"
|
|
192
|
+
*/
|
|
193
|
+
trustLevel?: TrustLevel;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* VS Code Spell Checker Settings
|
|
197
|
+
* To be Removed
|
|
198
|
+
* @deprecated
|
|
199
|
+
*/
|
|
200
|
+
export interface LegacySettings {
|
|
201
|
+
/**
|
|
202
|
+
* Show status
|
|
203
|
+
* @deprecated
|
|
204
|
+
*/
|
|
205
|
+
showStatus?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Delay in ms after a document has changed before checking it for spelling errors.
|
|
208
|
+
* @deprecated
|
|
209
|
+
*/
|
|
210
|
+
spellCheckDelayMs?: number;
|
|
211
|
+
}
|
|
212
|
+
export interface OverrideSettings extends Settings, OverrideFilterFields {
|
|
213
|
+
/** Sets the programming language id */
|
|
214
|
+
languageId?: LanguageId;
|
|
215
|
+
/** Sets the locale */
|
|
216
|
+
language?: LocaleId;
|
|
217
|
+
}
|
|
218
|
+
export interface OverrideFilterFields {
|
|
219
|
+
/** Glob pattern or patterns to match against */
|
|
220
|
+
filename: Glob | Glob[];
|
|
221
|
+
}
|
|
222
|
+
export interface BaseSetting {
|
|
223
|
+
/** Optional identifier */
|
|
224
|
+
id?: string;
|
|
225
|
+
/** Optional name of configuration */
|
|
226
|
+
name?: string;
|
|
227
|
+
/** Optional description of configuration */
|
|
228
|
+
description?: string;
|
|
229
|
+
/**
|
|
230
|
+
* Is the spell checker enabled
|
|
231
|
+
* @default true
|
|
232
|
+
*/
|
|
233
|
+
enabled?: boolean;
|
|
234
|
+
/** list of words to be always considered correct */
|
|
235
|
+
words?: string[];
|
|
236
|
+
/** list of words to always be considered incorrect. */
|
|
237
|
+
flagWords?: string[];
|
|
238
|
+
/** List of words to be ignored. An Ignored word will not show up as an error even if it is also in the `flagWords`. */
|
|
239
|
+
ignoreWords?: string[];
|
|
240
|
+
/**
|
|
241
|
+
* True to enable compound word checking.
|
|
242
|
+
* @default false
|
|
243
|
+
*/
|
|
244
|
+
allowCompoundWords?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Words must match case rules.
|
|
247
|
+
* @default false
|
|
248
|
+
*/
|
|
249
|
+
caseSensitive?: boolean;
|
|
250
|
+
/** Define additional available dictionaries */
|
|
251
|
+
dictionaryDefinitions?: DictionaryDefinition[];
|
|
252
|
+
/**
|
|
253
|
+
* Optional list of dictionaries to use.
|
|
254
|
+
* Each entry should match the name of the dictionary.
|
|
255
|
+
* To remove a dictionary from the list add `!` before the name.
|
|
256
|
+
* i.e. `!typescript` will turn off the dictionary with the name `typescript`.
|
|
257
|
+
*/
|
|
258
|
+
dictionaries?: DictionaryReference[];
|
|
259
|
+
/**
|
|
260
|
+
* Optional list of dictionaries that will not be used for suggestions.
|
|
261
|
+
* Words in these dictionaries are considered correct, but will not be
|
|
262
|
+
* used when making spell correction suggestions.
|
|
263
|
+
*
|
|
264
|
+
* Note: if a word is suggested by another dictionary, but found in
|
|
265
|
+
* one of these dictionaries, it will be removed from the set of
|
|
266
|
+
* possible suggestions.
|
|
267
|
+
*/
|
|
268
|
+
noSuggestDictionaries?: DictionaryReference[];
|
|
269
|
+
/**
|
|
270
|
+
* List of RegExp patterns or Pattern names to exclude from spell checking.
|
|
271
|
+
*
|
|
272
|
+
* Example: ["href"] - to exclude html href
|
|
273
|
+
*/
|
|
274
|
+
ignoreRegExpList?: RegExpPatternList;
|
|
275
|
+
/**
|
|
276
|
+
* List of RegExp patterns or defined Pattern names to define the text to be included for spell checking.
|
|
277
|
+
* If includeRegExpList is defined, ONLY, text matching the included patterns will be checked.
|
|
278
|
+
*/
|
|
279
|
+
includeRegExpList?: RegExpPatternList;
|
|
280
|
+
/** Defines a list of patterns that can be used in ignoreRegExpList and includeRegExpList */
|
|
281
|
+
patterns?: RegExpPatternDefinition[];
|
|
282
|
+
}
|
|
283
|
+
export declare type DictionaryFileTypes = 'S' | 'W' | 'C' | 'T';
|
|
284
|
+
export declare type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
|
|
285
|
+
export interface DictionaryDefinitionBase {
|
|
286
|
+
/**
|
|
287
|
+
* This is the name of a dictionary.
|
|
288
|
+
*
|
|
289
|
+
* Name Format:
|
|
290
|
+
* - Must contain at least 1 number or letter.
|
|
291
|
+
* - spaces are allowed.
|
|
292
|
+
* - Leading and trailing space will be removed.
|
|
293
|
+
* - Names ARE case-sensitive
|
|
294
|
+
* - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`
|
|
295
|
+
*/
|
|
296
|
+
name: DictionaryId;
|
|
297
|
+
/** Optional description */
|
|
298
|
+
description?: string;
|
|
299
|
+
/** Replacement pairs */
|
|
300
|
+
repMap?: ReplaceMap;
|
|
301
|
+
/** Use Compounds */
|
|
302
|
+
useCompounds?: boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Indicate that suggestions should not come from this dictionary.
|
|
305
|
+
* Words in this dictionary are considered correct, but will not be
|
|
306
|
+
* used when making spell correction suggestions.
|
|
307
|
+
*
|
|
308
|
+
* Note: if a word is suggested by another dictionary, but found in
|
|
309
|
+
* this dictionary, it will be removed from the set of
|
|
310
|
+
* possible suggestions.
|
|
311
|
+
*/
|
|
312
|
+
noSuggest?: boolean;
|
|
313
|
+
}
|
|
314
|
+
export interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
|
|
315
|
+
/** Path to the file */
|
|
316
|
+
path: DictionaryPath;
|
|
317
|
+
/**
|
|
318
|
+
* Only for legacy dictionary definitions
|
|
319
|
+
* @deprecated
|
|
320
|
+
* @deprecationMessage Use `path` instead.
|
|
321
|
+
* @hidden
|
|
322
|
+
*/
|
|
323
|
+
file?: undefined;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Only for legacy dictionary definitions
|
|
327
|
+
* @deprecated
|
|
328
|
+
* @deprecationMessage Use `DictionaryDefinitionPreferred`
|
|
329
|
+
*/
|
|
330
|
+
export interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase {
|
|
331
|
+
/** @hidden */
|
|
332
|
+
path?: undefined;
|
|
333
|
+
/**
|
|
334
|
+
* Path to the file, only for legacy dictionary definitions
|
|
335
|
+
* @deprecated
|
|
336
|
+
* @deprecationMessage Use `path` instead.
|
|
337
|
+
*/
|
|
338
|
+
file: DictionaryPath;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* @deprecated
|
|
342
|
+
* @hidden
|
|
343
|
+
*/
|
|
344
|
+
export interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
|
|
345
|
+
/** Path to the file, if undefined the path to the extension dictionaries is assumed */
|
|
346
|
+
path?: FsPath;
|
|
347
|
+
/**
|
|
348
|
+
* File name
|
|
349
|
+
* @deprecated
|
|
350
|
+
* @deprecationMessage Use path instead.
|
|
351
|
+
*/
|
|
352
|
+
file: FsPath;
|
|
353
|
+
/**
|
|
354
|
+
* Type of file:
|
|
355
|
+
* S - single word per line,
|
|
356
|
+
* W - each line can contain one or more words separated by space,
|
|
357
|
+
* C - each line is treated like code (Camel Case is allowed)
|
|
358
|
+
* Default is S
|
|
359
|
+
* C is the slowest to load due to the need to split each line based upon code splitting rules.
|
|
360
|
+
* @default "S"
|
|
361
|
+
*/
|
|
362
|
+
type?: DictionaryFileTypes;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Specifies the scope of a dictionary.
|
|
366
|
+
*/
|
|
367
|
+
export declare type CustomDictionaryScope = 'user' | 'workspace' | 'folder';
|
|
368
|
+
/**
|
|
369
|
+
* For Defining Custom dictionaries. They are generally scoped to a
|
|
370
|
+
* `user`, `workspace`, or `folder`.
|
|
371
|
+
* When `addWords` is true, indicates that the spell checker can add words
|
|
372
|
+
* to the file.
|
|
373
|
+
* Note: only plain text files with one word per line are supported at this moment.
|
|
374
|
+
*/
|
|
375
|
+
export interface DictionaryDefinitionCustom extends DictionaryDefinitionPreferred {
|
|
376
|
+
/** Path to custom dictionary text file. */
|
|
377
|
+
path: CustomDictionaryPath;
|
|
378
|
+
/**
|
|
379
|
+
* Defines the scope for when words will be added to the dictionary.
|
|
380
|
+
* Scope values: `user`, `workspace`, `folder`
|
|
381
|
+
*/
|
|
382
|
+
scope?: CustomDictionaryScope | CustomDictionaryScope[];
|
|
383
|
+
/**
|
|
384
|
+
* When `true`, let's the spell checker know that words can be added to this dictionary.
|
|
385
|
+
*/
|
|
386
|
+
addWords: boolean;
|
|
387
|
+
}
|
|
388
|
+
export interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {
|
|
389
|
+
}
|
|
390
|
+
export interface LanguageSettingFilterFields extends LanguageSettingFilterFieldsPreferred, LanguageSettingFilterFieldsDeprecated {
|
|
391
|
+
}
|
|
392
|
+
export interface LanguageSettingFilterFieldsPreferred {
|
|
393
|
+
/** The language id. Ex: "typescript", "html", or "php". "*" -- will match all languages */
|
|
394
|
+
languageId: LanguageId | LanguageIdSingle[];
|
|
395
|
+
/** The locale filter, matches against the language. This can be a comma separated list. "*" will match all locales. */
|
|
396
|
+
locale?: LocaleId | LocaleId[];
|
|
397
|
+
}
|
|
398
|
+
export interface LanguageSettingFilterFieldsDeprecated {
|
|
399
|
+
/** The language id. Ex: "typescript", "html", or "php". "*" -- will match all languages */
|
|
400
|
+
languageId: LanguageId | LanguageIdSingle[];
|
|
401
|
+
/**
|
|
402
|
+
* Deprecated - The locale filter, matches against the language. This can be a comma separated list. "*" will match all locales.
|
|
403
|
+
* @deprecated
|
|
404
|
+
* @deprecationMessage Use `locale` instead
|
|
405
|
+
*/
|
|
406
|
+
local?: LocaleId | LocaleId[];
|
|
407
|
+
}
|
|
408
|
+
/** @hidden */
|
|
409
|
+
declare type InternalRegExp = RegExp;
|
|
410
|
+
export declare type Pattern = string | InternalRegExp;
|
|
411
|
+
export declare type PredefinedPatterns = 'Base64' | 'CStyleComment' | 'CStyleHexValue' | 'CSSHexValue' | 'CommitHash' | 'CommitHashLink' | 'Email' | 'EscapeCharacters' | 'HexValues' | 'href' | 'PhpHereDoc' | 'PublicKey' | 'RsaCert' | 'SHA' | 'SpellCheckerDisable' | 'SpellCheckerDisableBlock' | 'SpellCheckerDisableLine' | 'SpellCheckerDisableNext' | 'SpellCheckerIgnoreInDocSetting' | 'string' | 'UnicodeRef' | 'Urls' | 'UUID' | 'Everything';
|
|
412
|
+
/** This matches the name in a pattern definition */
|
|
413
|
+
export declare type PatternId = string;
|
|
414
|
+
/** A PatternRef is a Pattern or PatternId. */
|
|
415
|
+
export declare type PatternRef = Pattern | PatternId | PredefinedPatterns;
|
|
416
|
+
/** A list of pattern names or regular expressions */
|
|
417
|
+
export declare type RegExpPatternList = PatternRef[];
|
|
418
|
+
/**
|
|
419
|
+
* This is the name of a dictionary.
|
|
420
|
+
*
|
|
421
|
+
* Name Format:
|
|
422
|
+
* - Must contain at least 1 number or letter.
|
|
423
|
+
* - spaces are allowed.
|
|
424
|
+
* - Leading and trailing space will be removed.
|
|
425
|
+
* - Names ARE case-sensitive
|
|
426
|
+
* - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`
|
|
427
|
+
*
|
|
428
|
+
* @pattern ^(?=[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
|
|
429
|
+
*/
|
|
430
|
+
export declare type DictionaryId = string;
|
|
431
|
+
/**
|
|
432
|
+
* This a reference to a named dictionary.
|
|
433
|
+
* It is expected to match the name of a dictionary.
|
|
434
|
+
*/
|
|
435
|
+
export declare type DictionaryRef = DictionaryId;
|
|
436
|
+
/**
|
|
437
|
+
* This a negative reference to a named dictionary.
|
|
438
|
+
*
|
|
439
|
+
* It is used to exclude or include a dictionary by name.
|
|
440
|
+
*
|
|
441
|
+
* The reference starts with 1 or more `!`.
|
|
442
|
+
* - `!<dictionary_name>` - Used to exclude the dictionary matching `<dictionary_name>`
|
|
443
|
+
* - `!!<dictionary_name>` - Used to re-include a dictionary matching `<dictionary_name>`
|
|
444
|
+
* Overrides `!<dictionary_name>`.
|
|
445
|
+
* - `!!!<dictionary_name>` - Used to exclude a dictionary matching `<dictionary_name>`
|
|
446
|
+
* Overrides `!!<dictionary_name>`.
|
|
447
|
+
*
|
|
448
|
+
* @pattern ^(?=!+[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
|
|
449
|
+
*/
|
|
450
|
+
export declare type DictionaryNegRef = string;
|
|
451
|
+
/**
|
|
452
|
+
* Reference to a dictionary by name.
|
|
453
|
+
* One of:
|
|
454
|
+
* - {@link DictionaryRef}
|
|
455
|
+
* - {@link DictionaryNegRef}
|
|
456
|
+
*/
|
|
457
|
+
export declare type DictionaryReference = DictionaryRef | DictionaryNegRef;
|
|
458
|
+
/** This is a written language locale like: 'en', 'en-GB', 'fr', 'es', 'de', etc. */
|
|
459
|
+
export declare type LocaleId = string;
|
|
460
|
+
/**
|
|
461
|
+
* Configuration File Version
|
|
462
|
+
*/
|
|
463
|
+
export declare type VersionLatest = '0.2';
|
|
464
|
+
/**
|
|
465
|
+
* Legacy Configuration File Versions
|
|
466
|
+
* @deprecated
|
|
467
|
+
* @deprecationMessage Use `0.2`
|
|
468
|
+
*/
|
|
469
|
+
export declare type VersionLegacy = '0.1';
|
|
470
|
+
export declare type Version = VersionLatest | VersionLegacy;
|
|
471
|
+
/**
|
|
472
|
+
* @deprecated
|
|
473
|
+
* @deprecationMessage Use LocaleId instead
|
|
474
|
+
*/
|
|
475
|
+
export declare type LocalId = LocaleId;
|
|
476
|
+
/** These are glob expressions */
|
|
477
|
+
export declare type Glob = SimpleGlob | GlobDef;
|
|
478
|
+
/** Simple Glob string, the root will be globRoot */
|
|
479
|
+
export declare type SimpleGlob = string;
|
|
480
|
+
/**
|
|
481
|
+
* Used to define fully qualified glob patterns.
|
|
482
|
+
* It is currently hidden to make the json-schema a bit easier to use
|
|
483
|
+
* when crafting cspell.json files by hand.
|
|
484
|
+
* @hidden
|
|
485
|
+
*/
|
|
486
|
+
export interface GlobDef {
|
|
487
|
+
/** Glob pattern to match */
|
|
488
|
+
glob: string;
|
|
489
|
+
/** Optional root to use when matching the glob. Defaults to current working dir. */
|
|
490
|
+
root?: string;
|
|
491
|
+
/**
|
|
492
|
+
* Optional source of the glob, used when merging settings to determine the origin.
|
|
493
|
+
* @hidden
|
|
494
|
+
*/
|
|
495
|
+
source?: string;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* This can be '*', 'typescript', 'cpp', 'json', etc.
|
|
499
|
+
* @pattern ^(!?[-\w_\s]+)|(\*)$
|
|
500
|
+
*/
|
|
501
|
+
export declare type LanguageIdSingle = string;
|
|
502
|
+
/**
|
|
503
|
+
* This can be 'typescript,cpp,json,literal haskell', etc.
|
|
504
|
+
* @pattern ^([-\w_\s]+)(,[-\w_\s]+)*$
|
|
505
|
+
*/
|
|
506
|
+
export declare type LanguageIdMultiple = string;
|
|
507
|
+
/**
|
|
508
|
+
* This can be 'typescript,cpp,json,literal haskell', etc.
|
|
509
|
+
* @pattern ^(![-\w_\s]+)(,![-\w_\s]+)*$
|
|
510
|
+
*/
|
|
511
|
+
export declare type LanguageIdMultipleNeg = string;
|
|
512
|
+
export declare type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
|
|
513
|
+
/** A File System Path */
|
|
514
|
+
export declare type FsPath = string;
|
|
515
|
+
/** Trust Security Level */
|
|
516
|
+
export declare type TrustLevel = 'trusted' | 'untrusted';
|
|
517
|
+
/**
|
|
518
|
+
* A File System Path to a dictionary file.
|
|
519
|
+
* @pattern ^.*\.(?:txt|trie)(?:\.gz)?$
|
|
520
|
+
*/
|
|
521
|
+
export declare type DictionaryPath = string;
|
|
522
|
+
/**
|
|
523
|
+
* A File System Path to a dictionary file.
|
|
524
|
+
* @pattern ^.*\.txt$
|
|
525
|
+
*/
|
|
526
|
+
export declare type CustomDictionaryPath = string;
|
|
527
|
+
export interface RegExpPatternDefinition {
|
|
528
|
+
/**
|
|
529
|
+
* Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList.
|
|
530
|
+
* It is possible to redefine one of the predefined patterns to override its value.
|
|
531
|
+
*/
|
|
532
|
+
name: PatternId;
|
|
533
|
+
/**
|
|
534
|
+
* RegExp pattern or array of RegExp patterns
|
|
535
|
+
*/
|
|
536
|
+
pattern: Pattern | Pattern[];
|
|
537
|
+
/**
|
|
538
|
+
* Description of the pattern.
|
|
539
|
+
*/
|
|
540
|
+
description?: string;
|
|
541
|
+
}
|
|
542
|
+
export declare type CSpellUserSettingsWithComments = CSpellUserSettings;
|
|
543
|
+
export declare type Source = FileSource | MergeSource | InMemorySource | BaseSource;
|
|
544
|
+
export interface FileSource extends BaseSource {
|
|
545
|
+
/** name of source */
|
|
546
|
+
name: string;
|
|
547
|
+
/** filename if this came from a file. */
|
|
548
|
+
filename: string;
|
|
549
|
+
/** The two settings that were merged to */
|
|
550
|
+
sources?: undefined;
|
|
551
|
+
/** The configuration read. */
|
|
552
|
+
fileSource: CSpellSettings;
|
|
553
|
+
}
|
|
554
|
+
export interface MergeSource extends BaseSource {
|
|
555
|
+
/** name of source */
|
|
556
|
+
name: string;
|
|
557
|
+
/** filename if this came from a file. */
|
|
558
|
+
filename?: undefined;
|
|
559
|
+
/** The two settings that were merged to */
|
|
560
|
+
sources: [CSpellSettings] | [CSpellSettings, CSpellSettings];
|
|
561
|
+
/** The configuration read. */
|
|
562
|
+
fileSource?: undefined;
|
|
563
|
+
}
|
|
564
|
+
export interface InMemorySource extends BaseSource {
|
|
565
|
+
/** name of source */
|
|
566
|
+
name: string;
|
|
567
|
+
/** filename if this came from a file. */
|
|
568
|
+
filename?: undefined;
|
|
569
|
+
/** The two settings that were merged to */
|
|
570
|
+
sources?: undefined;
|
|
571
|
+
/** The configuration read. */
|
|
572
|
+
fileSource?: undefined;
|
|
573
|
+
}
|
|
574
|
+
interface BaseSource {
|
|
575
|
+
/** name of source */
|
|
576
|
+
name: string;
|
|
577
|
+
/** filename if this came from a file. */
|
|
578
|
+
filename?: string;
|
|
579
|
+
/** The two settings that were merged to */
|
|
580
|
+
sources?: [CSpellSettings] | [CSpellSettings, CSpellSettings];
|
|
581
|
+
/** The configuration read. */
|
|
582
|
+
fileSource?: CSpellSettings;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* reporter name or reporter name + reporter config
|
|
586
|
+
*/
|
|
587
|
+
export declare type ReporterSettings = string | [string] | [string, unknown];
|
|
588
|
+
export {};
|
|
589
|
+
//# sourceMappingURL=CSpellSettingsDef.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./CSpellSettingsDef"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "5.12.
|
|
6
|
+
"version": "5.12.4",
|
|
7
7
|
"description": "Types for cspell and cspell-lib",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"typings": "dist/index.d.ts",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"ajv-cli": "^5.0.0",
|
|
52
|
-
"jest": "^27.
|
|
52
|
+
"jest": "^27.3.1",
|
|
53
53
|
"rimraf": "^3.0.2",
|
|
54
|
-
"ts-json-schema-generator": "^0.
|
|
55
|
-
"typedoc": "^0.22.
|
|
56
|
-
"typedoc-plugin-markdown": "^3.11.
|
|
57
|
-
"typescript": "^4.4.
|
|
54
|
+
"ts-json-schema-generator": "^0.96.0",
|
|
55
|
+
"typedoc": "^0.22.7",
|
|
56
|
+
"typedoc-plugin-markdown": "^3.11.3",
|
|
57
|
+
"typescript": "^4.4.4"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "3e9973c39725f65141683b373ed839562f28bd94"
|
|
60
60
|
}
|