@cspell/cspell-types 9.0.1 → 9.1.0
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 +108 -98
- package/dist/Parser/index.d.mts +2 -127
- package/dist/Parser/index.d.ts +2 -127
- package/dist/Parser/index.js +0 -18
- package/dist/index-B8R3-rR5.d.mts +129 -0
- package/dist/index-CY-3Hv0u.d.ts +129 -0
- package/dist/index.d.mts +1581 -1397
- package/dist/index.d.ts +1581 -1397
- package/dist/index.js +87 -107
- package/dist/index.mjs +83 -77
- package/package.json +4 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,1371 +1,1554 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { ParseResult, ParsedText, ParserOptions } from './Parser/index.js';
|
|
1
|
+
import { ParseResult, ParsedText, Parser, ParserName, ParserOptions } from "./index-CY-3Hv0u.js";
|
|
3
2
|
|
|
3
|
+
//#region src/SuggestionsConfiguration.d.ts
|
|
4
|
+
interface SuggestionsConfiguration {
|
|
5
|
+
/**
|
|
6
|
+
* Number of suggestions to make.
|
|
7
|
+
*
|
|
8
|
+
* @default 10
|
|
9
|
+
*/
|
|
10
|
+
numSuggestions?: number;
|
|
11
|
+
/**
|
|
12
|
+
* The maximum amount of time in milliseconds to generate suggestions for a word.
|
|
13
|
+
*
|
|
14
|
+
* @default 500
|
|
15
|
+
*/
|
|
16
|
+
suggestionsTimeout?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The maximum number of changes allowed on a word to be considered a suggestions.
|
|
19
|
+
*
|
|
20
|
+
* For example, appending an `s` onto `example` -> `examples` is considered 1 change.
|
|
21
|
+
*
|
|
22
|
+
* Range: between 1 and 5.
|
|
23
|
+
*
|
|
24
|
+
* @default 3
|
|
25
|
+
*/
|
|
26
|
+
suggestionNumChanges?: number;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/TextOffset.d.ts
|
|
4
30
|
interface TextOffset {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The text found at the offset. If the text has been transformed, then the length might not match `length`.
|
|
33
|
+
* Example: Original: `cafe\u0301`, text: `café`
|
|
34
|
+
*/
|
|
35
|
+
text: string;
|
|
36
|
+
/**
|
|
37
|
+
* The offset into the document.
|
|
38
|
+
*/
|
|
39
|
+
offset: number;
|
|
40
|
+
/**
|
|
41
|
+
* Assumed to match `text.length` if the text has not been transformed.
|
|
42
|
+
*/
|
|
43
|
+
length?: number;
|
|
18
44
|
}
|
|
19
45
|
interface TextDocumentOffset extends TextOffset {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
46
|
+
uri?: string;
|
|
47
|
+
doc: string;
|
|
48
|
+
row: number;
|
|
49
|
+
col: number;
|
|
50
|
+
line: TextOffset;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/CSpellReporter.d.ts
|
|
27
54
|
interface Suggestion {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
interface Issue extends Omit<TextDocumentOffset,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Word to suggest.
|
|
57
|
+
*/
|
|
58
|
+
word: string;
|
|
59
|
+
/**
|
|
60
|
+
* The suggested word adjusted to match the original case.
|
|
61
|
+
*/
|
|
62
|
+
wordAdjustedToMatchCase?: string;
|
|
63
|
+
/**
|
|
64
|
+
* `true` - if this suggestion can be an automatic fix.
|
|
65
|
+
*/
|
|
66
|
+
isPreferred?: boolean;
|
|
67
|
+
}
|
|
68
|
+
interface Issue extends Omit<TextDocumentOffset, "doc"> {
|
|
69
|
+
/**
|
|
70
|
+
* The text surrounding the issue text. It is only included if the reporter cannot generated it automatically.
|
|
71
|
+
*/
|
|
72
|
+
context?: TextOffset | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* true if the issue has been flagged as a forbidden word.
|
|
75
|
+
*/
|
|
76
|
+
isFlagged?: boolean | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* An optional array of replacement strings.
|
|
79
|
+
*/
|
|
80
|
+
suggestions?: string[] | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* An optional array of suggestions.
|
|
83
|
+
*/
|
|
84
|
+
suggestionsEx?: Suggestion[] | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Issues are spelling issues unless otherwise specified.
|
|
87
|
+
*/
|
|
88
|
+
issueType?: IssueType | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Optional message to show.
|
|
91
|
+
*/
|
|
92
|
+
message?: string | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* `true` - if it has been determined if simple suggestions are available.
|
|
95
|
+
* `false` - if simple suggestions are NOT available.
|
|
96
|
+
* `undefined` - if it has not been determined.
|
|
97
|
+
* @since 9.1.0
|
|
98
|
+
*/
|
|
99
|
+
hasSimpleSuggestions?: boolean | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* This setting is used for common typo detection.
|
|
102
|
+
* - `true` - if it has been determined if preferred suggestions are available.
|
|
103
|
+
* - `false` - if preferred suggestions are NOT available.
|
|
104
|
+
* - `undefined` - if it has not been determined.
|
|
105
|
+
* @since 9.1.0
|
|
106
|
+
*/
|
|
107
|
+
hasPreferredSuggestions?: boolean | undefined;
|
|
64
108
|
}
|
|
65
109
|
declare enum IssueType {
|
|
66
|
-
|
|
67
|
-
|
|
110
|
+
spelling = 0,
|
|
111
|
+
directive = 1,
|
|
68
112
|
}
|
|
69
|
-
type MessageType =
|
|
70
|
-
type MessageTypeLookup = {
|
|
71
|
-
[key in MessageType]: key;
|
|
72
|
-
};
|
|
113
|
+
type MessageType = "Debug" | "Info" | "Warning";
|
|
114
|
+
type MessageTypeLookup = { [key in MessageType]: key };
|
|
73
115
|
declare const MessageTypes: MessageTypeLookup;
|
|
74
116
|
type MessageEmitter = (message: string, msgType: MessageType) => void;
|
|
75
117
|
type DebugEmitter = (message: string) => void;
|
|
76
118
|
type ErrorLike = Error | {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
119
|
+
message: string;
|
|
120
|
+
name: string;
|
|
121
|
+
toString: () => string;
|
|
80
122
|
};
|
|
81
123
|
type ErrorEmitter = (message: string, error: ErrorLike) => void;
|
|
82
|
-
type SpellingErrorEmitter = (issue: Issue) => void;
|
|
83
|
-
type ProgressTypes =
|
|
124
|
+
type SpellingErrorEmitter = (issue: Issue, options?: ReportIssueOptions) => void;
|
|
125
|
+
type ProgressTypes = "ProgressFileBegin" | "ProgressFileComplete";
|
|
84
126
|
type ProgressItem = ProgressFileBegin | ProgressFileComplete;
|
|
85
127
|
interface ProgressBase {
|
|
86
|
-
|
|
128
|
+
type: ProgressTypes;
|
|
87
129
|
}
|
|
88
130
|
interface ProgressFileBase extends ProgressBase {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
131
|
+
type: ProgressTypes;
|
|
132
|
+
/**
|
|
133
|
+
* The sequence number of the file being processed.
|
|
134
|
+
*/
|
|
135
|
+
fileNum: number;
|
|
136
|
+
/**
|
|
137
|
+
* The total number of files being processed.
|
|
138
|
+
*/
|
|
139
|
+
fileCount: number;
|
|
140
|
+
/**
|
|
141
|
+
* The file name or href of file being processed.
|
|
142
|
+
*/
|
|
143
|
+
filename: string;
|
|
93
144
|
}
|
|
94
145
|
interface ProgressFileComplete extends ProgressFileBase {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
146
|
+
type: "ProgressFileComplete";
|
|
147
|
+
/**
|
|
148
|
+
* The time it took to process the file in milliseconds.
|
|
149
|
+
* If `undefined`, then the elapsed time is not available.
|
|
150
|
+
*/
|
|
151
|
+
elapsedTimeMs: number | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* `true` if the file was processed.
|
|
154
|
+
* `false` if the file was skipped.
|
|
155
|
+
*/
|
|
156
|
+
processed: boolean | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Number of errors and issues found in the file.
|
|
159
|
+
*/
|
|
160
|
+
numErrors: number | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* `true` if the file was processed from the cache.
|
|
163
|
+
*/
|
|
164
|
+
cached?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Issues found in the file.
|
|
167
|
+
* If `undefined`, then the issues are not available.
|
|
168
|
+
*/
|
|
169
|
+
issues?: Iterable<Issue> | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* reportIssuesOptions to be used when reporting issues.
|
|
172
|
+
*/
|
|
173
|
+
reportIssueOptions?: ReportIssueOptions | undefined;
|
|
100
174
|
}
|
|
101
175
|
/**
|
|
102
|
-
|
|
103
|
-
|
|
176
|
+
* Notification sent just before processing a file.
|
|
177
|
+
*/
|
|
104
178
|
interface ProgressFileBegin extends ProgressFileBase {
|
|
105
|
-
|
|
179
|
+
type: "ProgressFileBegin";
|
|
106
180
|
}
|
|
107
181
|
type ProgressEmitter = (p: ProgressItem | ProgressFileComplete) => void;
|
|
108
182
|
interface RunResult {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
183
|
+
/** Number of files processed. */
|
|
184
|
+
files: number;
|
|
185
|
+
/** Set of files where issues were found. */
|
|
186
|
+
filesWithIssues: Set<string>;
|
|
187
|
+
/** Number of issues found. */
|
|
188
|
+
issues: number;
|
|
189
|
+
/** Number of processing errors. */
|
|
190
|
+
errors: number;
|
|
191
|
+
/** Number files that used results from the cache. */
|
|
192
|
+
cachedFiles?: number;
|
|
119
193
|
}
|
|
120
194
|
type ResultEmitter = (result: RunResult) => void | Promise<void>;
|
|
121
|
-
interface
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
195
|
+
interface CSpellReporterEmitters {
|
|
196
|
+
issue?: SpellingErrorEmitter;
|
|
197
|
+
info?: MessageEmitter;
|
|
198
|
+
debug?: DebugEmitter;
|
|
199
|
+
error?: ErrorEmitter;
|
|
200
|
+
progress?: ProgressEmitter;
|
|
201
|
+
result?: ResultEmitter;
|
|
202
|
+
}
|
|
203
|
+
interface CSpellReporter extends CSpellReporterEmitters {
|
|
204
|
+
/**
|
|
205
|
+
* Allows the reporter to specify supported features.
|
|
206
|
+
* @since 9.1.0
|
|
207
|
+
*/
|
|
208
|
+
features?: FeaturesSupportedByReporter | undefined;
|
|
128
209
|
}
|
|
129
210
|
interface ReporterConfigurationBase {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
211
|
+
/**
|
|
212
|
+
* The maximum number of problems to report in a file.
|
|
213
|
+
*
|
|
214
|
+
* @default 10000
|
|
215
|
+
*/
|
|
216
|
+
maxNumberOfProblems?: number;
|
|
217
|
+
/**
|
|
218
|
+
* The maximum number of times the same word can be flagged as an error in a file.
|
|
219
|
+
*
|
|
220
|
+
* @default 5
|
|
221
|
+
*/
|
|
222
|
+
maxDuplicateProblems?: number;
|
|
223
|
+
/**
|
|
224
|
+
* The minimum length of a word before checking it against a dictionary.
|
|
225
|
+
*
|
|
226
|
+
* @default 4
|
|
227
|
+
*/
|
|
228
|
+
minWordLength?: number;
|
|
229
|
+
/**
|
|
230
|
+
* Ignore sequences of characters that look like random strings.
|
|
231
|
+
*
|
|
232
|
+
* @default true
|
|
233
|
+
*/
|
|
234
|
+
ignoreRandomStrings?: boolean | undefined;
|
|
235
|
+
/**
|
|
236
|
+
* The minimum length of a random string to be ignored.
|
|
237
|
+
*
|
|
238
|
+
* @default 40
|
|
239
|
+
*/
|
|
240
|
+
minRandomLength?: number | undefined;
|
|
160
241
|
}
|
|
161
242
|
interface ReporterCommandLineOptions {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
interface ReporterConfiguration extends ReporterCommandLineOptions, ReporterConfigurationBase {
|
|
184
|
-
}
|
|
243
|
+
/**
|
|
244
|
+
* Display verbose information
|
|
245
|
+
*/
|
|
246
|
+
verbose?: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Show extensive output.
|
|
249
|
+
*/
|
|
250
|
+
debug?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Only report the words, no line numbers or file names.
|
|
253
|
+
*/
|
|
254
|
+
wordsOnly?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* unique errors per file only.
|
|
257
|
+
*/
|
|
258
|
+
unique?: boolean;
|
|
259
|
+
/**
|
|
260
|
+
* root directory, defaults to `cwd`
|
|
261
|
+
*/
|
|
262
|
+
root?: string;
|
|
263
|
+
}
|
|
264
|
+
interface ReporterConfiguration extends ReporterCommandLineOptions, ReporterConfigurationBase {}
|
|
185
265
|
interface CSpellReporterModule {
|
|
186
|
-
|
|
266
|
+
getReporter: (settings: unknown, config: ReporterConfiguration) => CSpellReporter;
|
|
187
267
|
}
|
|
188
|
-
|
|
189
268
|
/**
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
269
|
+
* Allows the reporter to advertise which features it supports.
|
|
270
|
+
*/
|
|
271
|
+
interface FeaturesSupportedByReporter {
|
|
272
|
+
/**
|
|
273
|
+
* The reporter supports the {@link ReportingConfiguration.unknownWords} option and understands
|
|
274
|
+
* how to filter issues based upon {@link Issue.isFlagged}, {@link Issue.hasSimpleSuggestions} and {@link Issue.hasPreferredSuggestions}.
|
|
275
|
+
* - `true` - The `reporter.issue` method will be called for all spelling issues and it is expected to handle .
|
|
276
|
+
* - `false | undefined` - the unknown words will be filtered out based upon the `unknownWords` setting before being passed to the reporter.
|
|
277
|
+
*/
|
|
278
|
+
unknownWords?: boolean | undefined;
|
|
279
|
+
/**
|
|
280
|
+
* The reporter supports the {@link Issue.issueType} option.
|
|
281
|
+
* - `true` - the reporter will be called with all issues types.
|
|
282
|
+
* - `false | undefined` - only {@link IssueType.spelling} issues will be passed to the reporter.
|
|
283
|
+
*/
|
|
284
|
+
issueType?: boolean | undefined;
|
|
285
|
+
/**
|
|
286
|
+
* The reporter can generate context for issues.
|
|
287
|
+
* - `true` - the reporter will be called with issues that do NOT have a `context` property.
|
|
288
|
+
* - `false | undefined` - the reporter will be called with issues that have a `context` property.
|
|
289
|
+
*/
|
|
290
|
+
contextGeneration?: boolean | undefined;
|
|
291
|
+
}
|
|
292
|
+
interface ReportingConfiguration extends ReporterConfigurationBase, SuggestionsConfiguration, UnknownWordsConfiguration {}
|
|
293
|
+
interface ReportIssueOptions extends UnknownWordsConfiguration {
|
|
294
|
+
/**
|
|
295
|
+
* Verify that the in-document directives are correct.
|
|
296
|
+
*/
|
|
297
|
+
validateDirectives?: boolean | undefined;
|
|
298
|
+
/**
|
|
299
|
+
* Tells the spell checker to show context around the issue.
|
|
300
|
+
* It is the number of characters to show on either side of the issue.
|
|
301
|
+
*/
|
|
302
|
+
showContext?: number | undefined;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Possible choices for how to handle unknown words.
|
|
306
|
+
*/
|
|
307
|
+
type UnknownWordsChoices = "report-all" | "report-simple" | "report-common-typos" | "report-flagged";
|
|
308
|
+
declare const unknownWordsChoices: {
|
|
309
|
+
readonly ReportAll: "report-all";
|
|
310
|
+
readonly ReportSimple: "report-simple";
|
|
311
|
+
readonly ReportCommonTypos: "report-common-typos";
|
|
312
|
+
readonly ReportFlagged: "report-flagged";
|
|
313
|
+
};
|
|
314
|
+
interface UnknownWordsConfiguration {
|
|
315
|
+
/**
|
|
316
|
+
* Controls how unknown words are handled.
|
|
317
|
+
*
|
|
318
|
+
* - `report-all` - Report all unknown words (default behavior)
|
|
319
|
+
* - `report-simple` - Report unknown words that have simple spelling errors, typos, and flagged words.
|
|
320
|
+
* - `report-common-typos` - Report unknown words that are common typos and flagged words.
|
|
321
|
+
* - `report-flagged` - Report unknown words that are flagged.
|
|
322
|
+
*
|
|
323
|
+
* @default "report-all"
|
|
324
|
+
* @since 9.1.0
|
|
325
|
+
*/
|
|
326
|
+
unknownWords?: UnknownWordsChoices | undefined;
|
|
327
|
+
}
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region src/suggestionCostsDef.d.ts
|
|
330
|
+
// cspell:ignore aeiouy
|
|
331
|
+
/**
|
|
332
|
+
* A WeightedMapDef enables setting weights for edits between related characters and substrings.
|
|
333
|
+
*
|
|
334
|
+
* Multiple groups can be defined using a `|`.
|
|
335
|
+
* A multi-character substring is defined using `()`.
|
|
336
|
+
*
|
|
337
|
+
* For example, in some languages, some letters sound alike.
|
|
338
|
+
*
|
|
339
|
+
* ```yaml
|
|
340
|
+
* map: 'sc(sh)(sch)(ss)|t(tt)' # two groups.
|
|
341
|
+
* replace: 50 # Make it 1/2 the cost of a normal edit to replace a `t` with `tt`.
|
|
342
|
+
* ```
|
|
343
|
+
*
|
|
344
|
+
* The following could be used to make inserting, removing, or replacing vowels cheaper.
|
|
345
|
+
* ```yaml
|
|
346
|
+
* map: 'aeiouy'
|
|
347
|
+
* insDel: 50 # Make it is cheaper to insert or delete a vowel.
|
|
348
|
+
* replace: 45 # It is even cheaper to replace one with another.
|
|
349
|
+
* ```
|
|
350
|
+
*
|
|
351
|
+
* Note: the default edit distance is 100.
|
|
352
|
+
*/
|
|
211
353
|
type SuggestionCostMapDef = CostMapDefReplace | CostMapDefInsDel | CostMapDefSwap;
|
|
212
354
|
type SuggestionCostsDefs = SuggestionCostMapDef[];
|
|
213
355
|
interface CostMapDefBase {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
356
|
+
/**
|
|
357
|
+
* The set of substrings to map, these are generally single character strings.
|
|
358
|
+
*
|
|
359
|
+
* Multiple sets can be defined by using a `|` to separate them.
|
|
360
|
+
*
|
|
361
|
+
* Example: `"eéê|aåá"` contains two different sets.
|
|
362
|
+
*
|
|
363
|
+
* To add a multi-character substring use `()`.
|
|
364
|
+
*
|
|
365
|
+
* Example: `"f(ph)(gh)"` results in the following set: `f`, `ph`, `gh`.
|
|
366
|
+
*
|
|
367
|
+
* - To match the beginning of a word, use `^`: `"(^I)""`.
|
|
368
|
+
* - To match the end of a word, use `$`: `"(e$)(ing$)"`.
|
|
369
|
+
*
|
|
370
|
+
*/
|
|
371
|
+
map: string;
|
|
372
|
+
/** The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. */
|
|
373
|
+
insDel?: number;
|
|
374
|
+
/**
|
|
375
|
+
* The cost to replace of of the substrings in the map with another substring in the map.
|
|
376
|
+
* Example: Map['a', 'i']
|
|
377
|
+
* This would be the cost to substitute `a` with `i`: Like `bat` to `bit` or the reverse.
|
|
378
|
+
*/
|
|
379
|
+
replace?: number;
|
|
380
|
+
/**
|
|
381
|
+
* The cost to swap two adjacent substrings found in the map.
|
|
382
|
+
* Example: Map['e', 'i']
|
|
383
|
+
* This represents the cost to change `ei` to `ie` or the reverse.
|
|
384
|
+
*/
|
|
385
|
+
swap?: number;
|
|
386
|
+
/**
|
|
387
|
+
* A description to describe the purpose of the map.
|
|
388
|
+
*/
|
|
389
|
+
description?: string;
|
|
390
|
+
/**
|
|
391
|
+
* Add a penalty to the final cost.
|
|
392
|
+
* This is used to discourage certain suggestions.
|
|
393
|
+
*
|
|
394
|
+
* Example:
|
|
395
|
+
* ```yaml
|
|
396
|
+
* # Match adding/removing `-` to the end of a word.
|
|
397
|
+
* map: "$(-$)"
|
|
398
|
+
* replace: 50
|
|
399
|
+
* penalty: 100
|
|
400
|
+
* ```
|
|
401
|
+
*
|
|
402
|
+
* This makes adding a `-` to the end of a word more expensive.
|
|
403
|
+
*
|
|
404
|
+
* Think of it as taking the toll way for speed but getting the bill later.
|
|
405
|
+
*/
|
|
406
|
+
penalty?: number;
|
|
265
407
|
}
|
|
266
408
|
interface CostMapDefReplace extends CostMapDefBase {
|
|
267
|
-
|
|
409
|
+
replace: number;
|
|
268
410
|
}
|
|
269
411
|
interface CostMapDefInsDel extends CostMapDefBase {
|
|
270
|
-
|
|
412
|
+
insDel: number;
|
|
271
413
|
}
|
|
272
414
|
interface CostMapDefSwap extends CostMapDefBase {
|
|
273
|
-
|
|
415
|
+
swap: number;
|
|
274
416
|
}
|
|
275
|
-
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/DictionaryInformation.d.ts
|
|
276
419
|
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
420
|
+
* Use by dictionary authors to help improve the quality of suggestions
|
|
421
|
+
* given from the dictionary.
|
|
422
|
+
*
|
|
423
|
+
* Added with `v5.16.0`.
|
|
424
|
+
*/
|
|
282
425
|
interface DictionaryInformation {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}
|
|
426
|
+
/**
|
|
427
|
+
* The locale of the dictionary.
|
|
428
|
+
* Example: `nl,nl-be`
|
|
429
|
+
*/
|
|
430
|
+
locale?: string;
|
|
431
|
+
/**
|
|
432
|
+
* The alphabet to use.
|
|
433
|
+
* @default "a-zA-Z"
|
|
434
|
+
*/
|
|
435
|
+
alphabet?: CharacterSet | CharacterSetCosts[];
|
|
436
|
+
/**
|
|
437
|
+
* The accent characters.
|
|
438
|
+
*
|
|
439
|
+
* Default: `"\u0300-\u0341"`
|
|
440
|
+
*/
|
|
441
|
+
accents?: CharacterSet | CharacterSetCosts[];
|
|
442
|
+
/**
|
|
443
|
+
* Define edit costs.
|
|
444
|
+
*/
|
|
445
|
+
costs?: EditCosts;
|
|
446
|
+
/**
|
|
447
|
+
* Used in making suggestions. The lower the value, the more likely the suggestion
|
|
448
|
+
* will be near the top of the suggestion list.
|
|
449
|
+
*/
|
|
450
|
+
suggestionEditCosts?: SuggestionCostsDefs | undefined;
|
|
451
|
+
/**
|
|
452
|
+
* Used by dictionary authors
|
|
453
|
+
*/
|
|
454
|
+
hunspellInformation?: HunspellInformation;
|
|
455
|
+
/**
|
|
456
|
+
* A collection of patterns to test against the suggested words.
|
|
457
|
+
* If the word matches the pattern, then the penalty is applied.
|
|
458
|
+
*/
|
|
459
|
+
adjustments?: PatternAdjustment[];
|
|
460
|
+
/**
|
|
461
|
+
* An optional set of characters that can possibly be removed from a word before
|
|
462
|
+
* checking it.
|
|
463
|
+
*
|
|
464
|
+
* This is useful in languages like Arabic where Harakat accents are optional.
|
|
465
|
+
*
|
|
466
|
+
* Note: All matching characters are removed or none. Partial removal is not supported.
|
|
467
|
+
*/
|
|
468
|
+
ignore?: CharacterSet;
|
|
469
|
+
}
|
|
470
|
+
// cspell:ignore aeistlunkodmrvpgjhäõbüoöfcwzxðqþ aàâä eéèêë iîïy
|
|
327
471
|
interface HunspellInformation {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
472
|
+
/**
|
|
473
|
+
* Selected Hunspell AFF content.
|
|
474
|
+
* The content must be UTF-8
|
|
475
|
+
*
|
|
476
|
+
* Sections:
|
|
477
|
+
* - TRY
|
|
478
|
+
* - MAP
|
|
479
|
+
* - REP
|
|
480
|
+
* - KEY
|
|
481
|
+
* - ICONV
|
|
482
|
+
* - OCONV
|
|
483
|
+
*
|
|
484
|
+
* Example:
|
|
485
|
+
* ```hunspell
|
|
486
|
+
* # Comment
|
|
487
|
+
* TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
|
|
488
|
+
* MAP aàâäAÀÂÄ
|
|
489
|
+
* MAP eéèêëEÉÈÊË
|
|
490
|
+
* MAP iîïyIÎÏY
|
|
491
|
+
* MAP oôöOÔÖ
|
|
492
|
+
* MAP (IJ)(IJ)
|
|
493
|
+
* ```
|
|
494
|
+
*/
|
|
495
|
+
aff: HunspellAffContent;
|
|
496
|
+
/** The costs to apply when using the hunspell settings */
|
|
497
|
+
costs?: HunspellCosts;
|
|
498
|
+
}
|
|
499
|
+
// cspell:ignore OCONV
|
|
355
500
|
/**
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
501
|
+
* Selected Hunspell AFF content.
|
|
502
|
+
* The content must be UTF-8
|
|
503
|
+
*
|
|
504
|
+
* Sections:
|
|
505
|
+
* - TRY
|
|
506
|
+
* - NO-TRY
|
|
507
|
+
* - MAP
|
|
508
|
+
* - REP
|
|
509
|
+
* - KEY
|
|
510
|
+
* - ICONV
|
|
511
|
+
* - OCONV
|
|
512
|
+
*
|
|
513
|
+
* Example:
|
|
514
|
+
* ```hunspell
|
|
515
|
+
* # Comment
|
|
516
|
+
* TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
|
|
517
|
+
* NO-TRY -0123456789 # Discourage adding numbers and dashes.
|
|
518
|
+
* MAP aàâäAÀÂÄ
|
|
519
|
+
* MAP eéèêëEÉÈÊË
|
|
520
|
+
* MAP iîïyIÎÏY
|
|
521
|
+
* MAP oôöOÔÖ
|
|
522
|
+
* MAP (IJ)(IJ)
|
|
523
|
+
* ```
|
|
524
|
+
*/
|
|
380
525
|
type HunspellAffContent = string;
|
|
381
526
|
interface HunspellCosts extends EditCosts {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
527
|
+
/**
|
|
528
|
+
* The cost of inserting / deleting / or swapping any `tryChars`
|
|
529
|
+
* Defaults to `baseCosts`
|
|
530
|
+
*/
|
|
531
|
+
tryCharCost?: number;
|
|
532
|
+
/**
|
|
533
|
+
* The cost of replacing or swapping any adjacent keyboard characters.
|
|
534
|
+
*
|
|
535
|
+
* This should be slightly cheaper than `tryCharCost`.
|
|
536
|
+
* @default 99
|
|
537
|
+
*/
|
|
538
|
+
keyboardCost?: number;
|
|
539
|
+
/**
|
|
540
|
+
* mapSet replacement cost is the cost to substitute one character with another from
|
|
541
|
+
* the same set.
|
|
542
|
+
*
|
|
543
|
+
* Map characters are considered very similar to each other and are often
|
|
544
|
+
* the cause of simple mistakes.
|
|
545
|
+
*
|
|
546
|
+
* @default 25
|
|
547
|
+
*/
|
|
548
|
+
mapCost?: number;
|
|
549
|
+
/**
|
|
550
|
+
* The cost to convert between convert pairs.
|
|
551
|
+
*
|
|
552
|
+
* The value should be slightly higher than the mapCost.
|
|
553
|
+
*
|
|
554
|
+
* @default 30
|
|
555
|
+
*/
|
|
556
|
+
ioConvertCost?: number;
|
|
557
|
+
/**
|
|
558
|
+
* The cost to substitute pairs found in the replace settings.
|
|
559
|
+
*
|
|
560
|
+
* @default 75
|
|
561
|
+
*/
|
|
562
|
+
replaceCosts?: number;
|
|
418
563
|
}
|
|
419
564
|
/**
|
|
420
|
-
|
|
421
|
-
|
|
565
|
+
*
|
|
566
|
+
*/
|
|
422
567
|
interface EditCosts {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
568
|
+
/**
|
|
569
|
+
* This is the base cost for making an edit.
|
|
570
|
+
* @default 100
|
|
571
|
+
*/
|
|
572
|
+
baseCost?: number;
|
|
573
|
+
/**
|
|
574
|
+
* This is the cost for characters not in the alphabet.
|
|
575
|
+
* @default 110
|
|
576
|
+
*/
|
|
577
|
+
nonAlphabetCosts?: number;
|
|
578
|
+
/**
|
|
579
|
+
* The extra cost incurred for changing the first letter of a word.
|
|
580
|
+
* This value should be less than `100 - baseCost`.
|
|
581
|
+
* @default 4
|
|
582
|
+
*/
|
|
583
|
+
firstLetterPenalty?: number;
|
|
584
|
+
/**
|
|
585
|
+
* The cost to change capitalization.
|
|
586
|
+
* This should be very cheap, it helps with fixing capitalization issues.
|
|
587
|
+
* @default 1
|
|
588
|
+
*/
|
|
589
|
+
capsCosts?: number;
|
|
590
|
+
/**
|
|
591
|
+
* The cost to add / remove an accent
|
|
592
|
+
* This should be very cheap, it helps with fixing accent issues.
|
|
593
|
+
* @default 1
|
|
594
|
+
*/
|
|
595
|
+
accentCosts?: number;
|
|
451
596
|
}
|
|
452
597
|
/**
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
598
|
+
* This is a set of characters that can include `-` or `|`
|
|
599
|
+
* - `-` - indicates a range of characters: `a-c` => `abc`
|
|
600
|
+
* - `|` - is a group separator, indicating that the characters on either side
|
|
601
|
+
* are not related.
|
|
602
|
+
*/
|
|
458
603
|
type CharacterSet = string;
|
|
459
604
|
interface CharacterSetCosts {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
605
|
+
/**
|
|
606
|
+
* This is a set of characters that can include `-` or `|`
|
|
607
|
+
* - `-` - indicates a range of characters: `a-c` => `abc`
|
|
608
|
+
* - `|` - is a group separator, indicating that the characters on either side
|
|
609
|
+
* are not related.
|
|
610
|
+
*/
|
|
611
|
+
characters: CharacterSet;
|
|
612
|
+
/** the cost to insert / delete / replace / swap the characters in a group */
|
|
613
|
+
cost: number;
|
|
614
|
+
/**
|
|
615
|
+
* The penalty cost to apply if the accent is used.
|
|
616
|
+
* This is used to discourage
|
|
617
|
+
*/
|
|
618
|
+
penalty?: number;
|
|
474
619
|
}
|
|
475
620
|
/**
|
|
476
|
-
|
|
477
|
-
|
|
621
|
+
* @hidden
|
|
622
|
+
*/
|
|
478
623
|
type IRegExp = RegExp;
|
|
479
624
|
interface PatternAdjustment {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
|
|
625
|
+
/** Id of the Adjustment, i.e. `short-compound` */
|
|
626
|
+
id: string;
|
|
627
|
+
/** RegExp pattern to match */
|
|
628
|
+
regexp: string | IRegExp;
|
|
629
|
+
/** The amount of penalty to apply. */
|
|
630
|
+
penalty: number;
|
|
631
|
+
}
|
|
632
|
+
//#endregion
|
|
633
|
+
//#region src/InlineDictionary.d.ts
|
|
488
634
|
interface InlineDictionary {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
635
|
+
/**
|
|
636
|
+
* List of words to be considered correct.
|
|
637
|
+
*/
|
|
638
|
+
words?: string[];
|
|
639
|
+
// cspell:ignore colour color canot incase
|
|
640
|
+
/**
|
|
641
|
+
* List of words to always be considered incorrect. Words found in `flagWords` override `words`.
|
|
642
|
+
*
|
|
643
|
+
* Format of `flagWords`
|
|
644
|
+
* - single word entry - `word`
|
|
645
|
+
* - with suggestions - `word:suggestion` or `word->suggestion, suggestions`
|
|
646
|
+
*
|
|
647
|
+
* Example:
|
|
648
|
+
* ```ts
|
|
649
|
+
* "flagWords": [
|
|
650
|
+
* "color: colour",
|
|
651
|
+
* "incase: in case, encase",
|
|
652
|
+
* "canot->cannot",
|
|
653
|
+
* "cancelled->canceled"
|
|
654
|
+
* ]
|
|
655
|
+
* ```
|
|
656
|
+
*/
|
|
657
|
+
flagWords?: string[];
|
|
658
|
+
/**
|
|
659
|
+
* List of words to be ignored. An ignored word will not show up as an error, even if it is
|
|
660
|
+
* also in the `flagWords`.
|
|
661
|
+
*/
|
|
662
|
+
ignoreWords?: string[];
|
|
663
|
+
/**
|
|
664
|
+
* A list of suggested replacements for words.
|
|
665
|
+
* Suggested words provide a way to make preferred suggestions on word replacements.
|
|
666
|
+
* To hint at a preferred change, but not to require it.
|
|
667
|
+
*
|
|
668
|
+
* Format of `suggestWords`
|
|
669
|
+
* - Single suggestion (possible auto fix)
|
|
670
|
+
* - `word: suggestion`
|
|
671
|
+
* - `word->suggestion`
|
|
672
|
+
* - Multiple suggestions (not auto fixable)
|
|
673
|
+
* - `word: first, second, third`
|
|
674
|
+
* - `word->first, second, third`
|
|
675
|
+
*/
|
|
676
|
+
suggestWords?: string[];
|
|
677
|
+
}
|
|
678
|
+
//#endregion
|
|
679
|
+
//#region src/DictionaryDefinition.d.ts
|
|
680
|
+
type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAugmented | DictionaryDefinitionInline | DictionaryDefinitionSimple | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
|
|
681
|
+
type DictionaryFileTypes = "S" | "W" | "C" | "T";
|
|
534
682
|
interface DictionaryDefinitionBase {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
683
|
+
/**
|
|
684
|
+
* This is the name of a dictionary.
|
|
685
|
+
*
|
|
686
|
+
* Name Format:
|
|
687
|
+
* - Must contain at least 1 number or letter.
|
|
688
|
+
* - Spaces are allowed.
|
|
689
|
+
* - Leading and trailing space will be removed.
|
|
690
|
+
* - Names ARE case-sensitive.
|
|
691
|
+
* - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
|
|
692
|
+
*/
|
|
693
|
+
name: DictionaryId;
|
|
694
|
+
/**
|
|
695
|
+
* Optional description of the contents / purpose of the dictionary.
|
|
696
|
+
*/
|
|
697
|
+
description?: string | undefined;
|
|
698
|
+
/** Replacement pairs. */
|
|
699
|
+
repMap?: ReplaceMap | undefined;
|
|
700
|
+
/** Use Compounds. */
|
|
701
|
+
useCompounds?: boolean | undefined;
|
|
702
|
+
/**
|
|
703
|
+
* Indicate that suggestions should not come from this dictionary.
|
|
704
|
+
* Words in this dictionary are considered correct, but will not be
|
|
705
|
+
* used when making spell correction suggestions.
|
|
706
|
+
*
|
|
707
|
+
* Note: if a word is suggested by another dictionary, but found in
|
|
708
|
+
* this dictionary, it will be removed from the set of
|
|
709
|
+
* possible suggestions.
|
|
710
|
+
*/
|
|
711
|
+
noSuggest?: boolean | undefined;
|
|
712
|
+
/**
|
|
713
|
+
* Some dictionaries may contain forbidden words to prevent compounding from generating
|
|
714
|
+
* words that are not valid in the language. These are often
|
|
715
|
+
* words that are used in other languages or might be generated through compounding.
|
|
716
|
+
* This setting allows flagged words to be ignored when checking the dictionary.
|
|
717
|
+
* The effect is similar to the word not being in the dictionary.
|
|
718
|
+
*/
|
|
719
|
+
ignoreForbiddenWords?: boolean | undefined;
|
|
720
|
+
/**
|
|
721
|
+
* Type of file:
|
|
722
|
+
* - S - single word per line,
|
|
723
|
+
* - W - each line can contain one or more words separated by space,
|
|
724
|
+
* - C - each line is treated like code (Camel Case is allowed).
|
|
725
|
+
*
|
|
726
|
+
* Default is S.
|
|
727
|
+
*
|
|
728
|
+
* C is the slowest to load due to the need to split each line based upon code splitting rules.
|
|
729
|
+
*
|
|
730
|
+
* Note: this settings does not apply to inline dictionaries or `.trie` files.
|
|
731
|
+
*
|
|
732
|
+
* @default "S"
|
|
733
|
+
*/
|
|
734
|
+
type?: DictionaryFileTypes | undefined;
|
|
735
|
+
/**
|
|
736
|
+
* Strip case and accents to allow for case insensitive searches and
|
|
737
|
+
* words without accents.
|
|
738
|
+
*
|
|
739
|
+
* Note: this setting only applies to word lists. It has no-impact on trie
|
|
740
|
+
* dictionaries.
|
|
741
|
+
*
|
|
742
|
+
* @default true
|
|
743
|
+
*/
|
|
744
|
+
supportNonStrictSearches?: boolean | undefined;
|
|
587
745
|
}
|
|
588
746
|
interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
747
|
+
/** Path to the file. */
|
|
748
|
+
path: DictionaryPath;
|
|
749
|
+
/**
|
|
750
|
+
* Only for legacy dictionary definitions.
|
|
751
|
+
* @deprecated true
|
|
752
|
+
* @deprecationMessage Use {@link path} instead.
|
|
753
|
+
* @hidden
|
|
754
|
+
*/
|
|
755
|
+
file?: undefined;
|
|
598
756
|
}
|
|
599
757
|
/**
|
|
600
|
-
|
|
601
|
-
|
|
758
|
+
* An Empty Dictionary Definition
|
|
759
|
+
*/
|
|
760
|
+
interface DictionaryDefinitionSimple extends DictionaryDefinitionBase {
|
|
761
|
+
/**
|
|
762
|
+
* @hide
|
|
763
|
+
*/
|
|
764
|
+
repMap?: ReplaceMap | undefined;
|
|
765
|
+
/**
|
|
766
|
+
* @hide
|
|
767
|
+
*/
|
|
768
|
+
useCompounds?: boolean | undefined;
|
|
769
|
+
/**
|
|
770
|
+
* @hide
|
|
771
|
+
*/
|
|
772
|
+
noSuggest?: boolean | undefined;
|
|
773
|
+
/**
|
|
774
|
+
* @hide
|
|
775
|
+
*/
|
|
776
|
+
ignoreForbiddenWords?: boolean | undefined;
|
|
777
|
+
/**
|
|
778
|
+
* @hide
|
|
779
|
+
*/
|
|
780
|
+
type?: DictionaryFileTypes | undefined;
|
|
781
|
+
/**
|
|
782
|
+
* @hide
|
|
783
|
+
*/
|
|
784
|
+
path?: string | undefined;
|
|
785
|
+
/**
|
|
786
|
+
* @hide
|
|
787
|
+
*/
|
|
788
|
+
file?: undefined;
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Used to provide extra data related to the dictionary
|
|
792
|
+
*/
|
|
602
793
|
interface DictionaryDefinitionAugmented extends DictionaryDefinitionPreferred {
|
|
603
|
-
|
|
794
|
+
dictionaryInformation?: DictionaryInformation;
|
|
795
|
+
}
|
|
796
|
+
interface HiddenFields {
|
|
797
|
+
/**
|
|
798
|
+
* Not used
|
|
799
|
+
* @hide
|
|
800
|
+
*/
|
|
801
|
+
path?: undefined;
|
|
802
|
+
/**
|
|
803
|
+
* Not used
|
|
804
|
+
* @hide
|
|
805
|
+
*/
|
|
806
|
+
file?: undefined;
|
|
807
|
+
/**
|
|
808
|
+
* Not used
|
|
809
|
+
* @hide
|
|
810
|
+
*/
|
|
811
|
+
type?: undefined;
|
|
812
|
+
/**
|
|
813
|
+
* Use `ignoreWords` instead.
|
|
814
|
+
* @hide
|
|
815
|
+
*/
|
|
816
|
+
noSuggest?: undefined;
|
|
817
|
+
/**
|
|
818
|
+
* Not used
|
|
819
|
+
* @hide
|
|
820
|
+
*/
|
|
821
|
+
ignoreForbiddenWords?: undefined;
|
|
822
|
+
/**
|
|
823
|
+
* Not used
|
|
824
|
+
* @hide
|
|
825
|
+
*/
|
|
826
|
+
useCompounds?: undefined;
|
|
827
|
+
/**
|
|
828
|
+
* @hide
|
|
829
|
+
*/
|
|
830
|
+
repMap?: undefined;
|
|
604
831
|
}
|
|
605
832
|
/**
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
* Not used
|
|
623
|
-
* @hidden
|
|
624
|
-
*/
|
|
625
|
-
type?: DictionaryDefinitionBase['type'];
|
|
626
|
-
/**
|
|
627
|
-
* Use `ignoreWords` instead.
|
|
628
|
-
* @hidden
|
|
629
|
-
*/
|
|
630
|
-
noSuggest?: DictionaryDefinitionBase['noSuggest'];
|
|
631
|
-
/**
|
|
632
|
-
* Not used
|
|
633
|
-
* @hidden
|
|
634
|
-
*/
|
|
635
|
-
ignoreForbiddenWords?: undefined;
|
|
636
|
-
}
|
|
637
|
-
interface DictionaryDefinitionInlineWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, 'words'>> {
|
|
638
|
-
words: string[];
|
|
639
|
-
}
|
|
640
|
-
interface DictionaryDefinitionInlineFlagWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, 'flagWords'>> {
|
|
641
|
-
flagWords: string[];
|
|
642
|
-
}
|
|
643
|
-
interface DictionaryDefinitionInlineIgnoreWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, 'ignoreWords'>> {
|
|
644
|
-
ignoreWords: string[];
|
|
645
|
-
}
|
|
646
|
-
interface DictionaryDefinitionInlineSuggestWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, 'suggestWords'>> {
|
|
647
|
-
suggestWords: string[];
|
|
833
|
+
* Inline Dictionary Definition
|
|
834
|
+
*
|
|
835
|
+
* All words are defined inline.
|
|
836
|
+
*/
|
|
837
|
+
type DictionaryDefinitionInlineBase = Omit<DictionaryDefinitionBase, keyof HiddenFields> & HiddenFields & InlineDictionary;
|
|
838
|
+
interface DictionaryDefinitionInlineWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, "words">> {
|
|
839
|
+
words: string[];
|
|
840
|
+
}
|
|
841
|
+
interface DictionaryDefinitionInlineFlagWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, "flagWords">> {
|
|
842
|
+
flagWords: string[];
|
|
843
|
+
}
|
|
844
|
+
interface DictionaryDefinitionInlineIgnoreWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, "ignoreWords">> {
|
|
845
|
+
ignoreWords: string[];
|
|
846
|
+
}
|
|
847
|
+
interface DictionaryDefinitionInlineSuggestWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, "suggestWords">> {
|
|
848
|
+
suggestWords: string[];
|
|
648
849
|
}
|
|
649
850
|
/**
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
851
|
+
* Inline Dictionary Definitions
|
|
852
|
+
* @since 6.23.0
|
|
853
|
+
*/
|
|
653
854
|
type DictionaryDefinitionInline = DictionaryDefinitionInlineWords | DictionaryDefinitionInlineIgnoreWords | DictionaryDefinitionInlineFlagWords | DictionaryDefinitionInlineSuggestWords;
|
|
654
855
|
/**
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
856
|
+
* Only for legacy dictionary definitions.
|
|
857
|
+
* @deprecated true
|
|
858
|
+
* @deprecationMessage Use {@link DictionaryDefinitionPreferred} instead.
|
|
859
|
+
*/
|
|
659
860
|
interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
861
|
+
/**
|
|
862
|
+
* @hidden
|
|
863
|
+
*/
|
|
864
|
+
path?: undefined;
|
|
865
|
+
/**
|
|
866
|
+
* Path to the file, only for legacy dictionary definitions.
|
|
867
|
+
* @deprecated true
|
|
868
|
+
* @deprecationMessage Use `path` instead.
|
|
869
|
+
*/
|
|
870
|
+
file: DictionaryPath;
|
|
871
|
+
/**
|
|
872
|
+
* @hidden
|
|
873
|
+
*/
|
|
874
|
+
suggestionEditCosts?: undefined;
|
|
670
875
|
}
|
|
671
876
|
/**
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
877
|
+
* @deprecated true
|
|
878
|
+
* @hidden
|
|
879
|
+
*/
|
|
675
880
|
interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
881
|
+
/** Path to the file, if undefined the path to the extension dictionaries is assumed. */
|
|
882
|
+
path?: FsDictionaryPath;
|
|
883
|
+
/**
|
|
884
|
+
* File name.
|
|
885
|
+
* @deprecated true
|
|
886
|
+
* @deprecationMessage Use {@link path} instead.
|
|
887
|
+
*/
|
|
888
|
+
file: FsDictionaryPath;
|
|
889
|
+
/**
|
|
890
|
+
* Type of file:
|
|
891
|
+
* - S - single word per line,
|
|
892
|
+
* - W - each line can contain one or more words separated by space,
|
|
893
|
+
* - C - each line is treated like code (Camel Case is allowed).
|
|
894
|
+
*
|
|
895
|
+
* Default is S.
|
|
896
|
+
*
|
|
897
|
+
* C is the slowest to load due to the need to split each line based upon code splitting rules.
|
|
898
|
+
* @default "S"
|
|
899
|
+
*/
|
|
900
|
+
type?: DictionaryFileTypes;
|
|
901
|
+
/**
|
|
902
|
+
* @hidden
|
|
903
|
+
*/
|
|
904
|
+
suggestionEditCosts?: undefined;
|
|
700
905
|
}
|
|
701
906
|
/**
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
type CustomDictionaryScope =
|
|
907
|
+
* Specifies the scope of a dictionary.
|
|
908
|
+
*/
|
|
909
|
+
type CustomDictionaryScope = "user" | "workspace" | "folder";
|
|
705
910
|
/**
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
911
|
+
* For Defining Custom dictionaries. They are generally scoped to a
|
|
912
|
+
* `user`, `workspace`, or `folder`.
|
|
913
|
+
* When `addWords` is true, indicates that the spell checker can add words
|
|
914
|
+
* to the file.
|
|
915
|
+
*
|
|
916
|
+
* Note: only plain text files with one word per line are supported at this moment.
|
|
917
|
+
*/
|
|
713
918
|
interface DictionaryDefinitionCustom extends DictionaryDefinitionPreferred {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
919
|
+
/** Path to custom dictionary text file. */
|
|
920
|
+
path: CustomDictionaryPath;
|
|
921
|
+
/**
|
|
922
|
+
* Defines the scope for when words will be added to the dictionary.
|
|
923
|
+
*
|
|
924
|
+
* Scope values: `user`, `workspace`, `folder`.
|
|
925
|
+
*/
|
|
926
|
+
scope?: CustomDictionaryScope | CustomDictionaryScope[];
|
|
927
|
+
/**
|
|
928
|
+
* When `true`, let's the spell checker know that words can be added to this dictionary.
|
|
929
|
+
*/
|
|
930
|
+
addWords: boolean;
|
|
726
931
|
}
|
|
727
932
|
/**
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
933
|
+
* This is the name of a dictionary.
|
|
934
|
+
*
|
|
935
|
+
* Name Format:
|
|
936
|
+
* - Must contain at least 1 number or letter.
|
|
937
|
+
* - Spaces are allowed.
|
|
938
|
+
* - Leading and trailing space will be removed.
|
|
939
|
+
* - Names ARE case-sensitive.
|
|
940
|
+
* - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
|
|
941
|
+
*
|
|
942
|
+
* @pattern ^(?=[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
|
|
943
|
+
*/
|
|
739
944
|
type DictionaryId = string;
|
|
740
945
|
type ReplaceEntry = [string, string];
|
|
741
946
|
type ReplaceMap = ReplaceEntry[];
|
|
742
947
|
/**
|
|
743
|
-
|
|
744
|
-
|
|
948
|
+
* A File System Path. Relative paths are relative to the configuration file.
|
|
949
|
+
*/
|
|
745
950
|
type FsDictionaryPath = string;
|
|
746
951
|
/**
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
952
|
+
* A File System Path to a dictionary file.
|
|
953
|
+
* Pattern: `^.*\.(?:txt|trie|dic)(?:\.gz)?$`
|
|
954
|
+
*/
|
|
750
955
|
type DictionaryPath = string;
|
|
751
956
|
/**
|
|
752
|
-
|
|
753
|
-
|
|
957
|
+
* A File System Path to a dictionary file.
|
|
958
|
+
*/
|
|
754
959
|
type CustomDictionaryPath = FsDictionaryPath;
|
|
755
960
|
/**
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
961
|
+
* Reference to a dictionary by name.
|
|
962
|
+
* One of:
|
|
963
|
+
* - {@link DictionaryRef}
|
|
964
|
+
* - {@link DictionaryNegRef}
|
|
965
|
+
*/
|
|
761
966
|
type DictionaryReference = DictionaryRef | DictionaryNegRef;
|
|
762
967
|
/**
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
968
|
+
* This a reference to a named dictionary.
|
|
969
|
+
* It is expected to match the name of a dictionary.
|
|
970
|
+
*/
|
|
766
971
|
type DictionaryRef = DictionaryId;
|
|
767
972
|
/**
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
973
|
+
* This a negative reference to a named dictionary.
|
|
974
|
+
*
|
|
975
|
+
* It is used to exclude or include a dictionary by name.
|
|
976
|
+
*
|
|
977
|
+
* The reference starts with 1 or more `!`.
|
|
978
|
+
* - `!<dictionary_name>` - Used to exclude the dictionary matching `<dictionary_name>`.
|
|
979
|
+
* - `!!<dictionary_name>` - Used to re-include a dictionary matching `<dictionary_name>`.
|
|
980
|
+
* Overrides `!<dictionary_name>`.
|
|
981
|
+
* - `!!!<dictionary_name>` - Used to exclude a dictionary matching `<dictionary_name>`.
|
|
982
|
+
* Overrides `!!<dictionary_name>`.
|
|
983
|
+
*
|
|
984
|
+
* @pattern ^(?=!+[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
|
|
985
|
+
*/
|
|
781
986
|
type DictionaryNegRef = string;
|
|
782
|
-
|
|
987
|
+
//#endregion
|
|
988
|
+
//#region src/features.d.ts
|
|
783
989
|
/**
|
|
784
|
-
|
|
785
|
-
|
|
990
|
+
* These are experimental features and are subject to change or removal without notice.
|
|
991
|
+
*/
|
|
786
992
|
interface FeaturesExperimental {
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
993
|
+
/**
|
|
994
|
+
* Enable/disable using weighted suggestions.
|
|
995
|
+
*/
|
|
996
|
+
"weighted-suggestions": FeatureEnableOnly;
|
|
791
997
|
}
|
|
792
998
|
/**
|
|
793
|
-
|
|
794
|
-
|
|
999
|
+
* These are the current set of active features
|
|
1000
|
+
*/
|
|
795
1001
|
interface FeaturesActive {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
1002
|
+
/**
|
|
1003
|
+
* @hidden
|
|
1004
|
+
*/
|
|
1005
|
+
featureName?: boolean;
|
|
800
1006
|
}
|
|
801
1007
|
/**
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
1008
|
+
* These are feature settings that have been deprecated or moved elsewhere they will have no
|
|
1009
|
+
* effect on the code but are here to prevent schema errors. The will get cleaned out on major versions.
|
|
1010
|
+
*/
|
|
805
1011
|
interface FeaturesDeprecated {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
1012
|
+
/**
|
|
1013
|
+
* @hidden
|
|
1014
|
+
*/
|
|
1015
|
+
featureName?: boolean;
|
|
810
1016
|
}
|
|
811
1017
|
/**
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
interface Features extends Partial<FeaturesActive>, Partial<FeaturesDeprecated>, Partial<FeaturesExperimental> {
|
|
815
|
-
}
|
|
1018
|
+
* Features are behaviors or settings that can be explicitly configured.
|
|
1019
|
+
*/
|
|
1020
|
+
interface Features extends Partial<FeaturesActive>, Partial<FeaturesDeprecated>, Partial<FeaturesExperimental> {}
|
|
816
1021
|
type Feature = FeatureEnableOnly | FeatureWithConfiguration;
|
|
817
1022
|
type FeatureEnableOnly = boolean;
|
|
818
1023
|
/**
|
|
819
|
-
|
|
820
|
-
|
|
1024
|
+
* Feature Configuration.
|
|
1025
|
+
*/
|
|
821
1026
|
interface FeatureWithConfiguration {
|
|
822
|
-
|
|
1027
|
+
enable: boolean;
|
|
823
1028
|
}
|
|
824
|
-
|
|
1029
|
+
//#endregion
|
|
1030
|
+
//#region src/types.d.ts
|
|
825
1031
|
type Serializable = number | string | boolean | null | object;
|
|
826
|
-
|
|
1032
|
+
//#endregion
|
|
1033
|
+
//#region src/CSpellSettingsDef.d.ts
|
|
827
1034
|
/**
|
|
828
|
-
|
|
829
|
-
|
|
1035
|
+
* These settings come from user and workspace settings.
|
|
1036
|
+
*/
|
|
830
1037
|
type CSpellPackageSettings = CSpellUserSettings;
|
|
831
1038
|
type CSpellUserSettings = CSpellSettings;
|
|
832
|
-
interface CSpellSettings extends FileSettings, LegacySettings {
|
|
833
|
-
}
|
|
1039
|
+
interface CSpellSettings extends FileSettings, LegacySettings {}
|
|
834
1040
|
interface ImportFileRef {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
1041
|
+
/** filename or URL */
|
|
1042
|
+
filename: string;
|
|
1043
|
+
error?: Error | undefined;
|
|
1044
|
+
referencedBy?: Source[];
|
|
839
1045
|
}
|
|
840
1046
|
interface CSpellSettingsWithSourceTrace extends CSpellSettings {
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
}
|
|
845
|
-
interface AdvancedCSpellSettingsWithSourceTrace extends CSpellSettingsWithSourceTrace, ExperimentalFileSettings {
|
|
1047
|
+
source?: Source | undefined;
|
|
1048
|
+
__importRef?: ImportFileRef;
|
|
1049
|
+
__imports?: Map<string, ImportFileRef>;
|
|
846
1050
|
}
|
|
1051
|
+
interface AdvancedCSpellSettingsWithSourceTrace extends CSpellSettingsWithSourceTrace, ExperimentalFileSettings {}
|
|
847
1052
|
interface FileSettings extends ExtendableSettings, CommandLineSettings {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Url to JSON Schema
|
|
1055
|
+
* @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json"
|
|
1056
|
+
*/
|
|
1057
|
+
$schema?: string;
|
|
1058
|
+
/**
|
|
1059
|
+
* Configuration format version of the settings file.
|
|
1060
|
+
*
|
|
1061
|
+
* This controls how the settings in the configuration file behave.
|
|
1062
|
+
*
|
|
1063
|
+
* @default "0.2"
|
|
1064
|
+
*/
|
|
1065
|
+
version?: Version;
|
|
1066
|
+
/** Words to add to global dictionary -- should only be in the user config file. */
|
|
1067
|
+
userWords?: string[];
|
|
1068
|
+
/**
|
|
1069
|
+
* Allows this configuration to inherit configuration for one or more other files.
|
|
1070
|
+
*
|
|
1071
|
+
* See [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details.
|
|
1072
|
+
*/
|
|
1073
|
+
import?: FsPath | FsPath[];
|
|
1074
|
+
/**
|
|
1075
|
+
* The root to use for glob patterns found in this configuration.
|
|
1076
|
+
* Default: location of the configuration file.
|
|
1077
|
+
* For compatibility reasons, config files with version 0.1, the glob root will
|
|
1078
|
+
* default to be `${cwd}`.
|
|
1079
|
+
*
|
|
1080
|
+
* Use `globRoot` to define a different location.
|
|
1081
|
+
* `globRoot` can be relative to the location of this configuration file.
|
|
1082
|
+
* Defining globRoot, does not impact imported configurations.
|
|
1083
|
+
*
|
|
1084
|
+
* Special Values:
|
|
1085
|
+
* - `${cwd}` - will be replaced with the current working directory.
|
|
1086
|
+
* - `.` - will be the location of the containing configuration file.
|
|
1087
|
+
*
|
|
1088
|
+
*/
|
|
1089
|
+
globRoot?: FSPathResolvable;
|
|
1090
|
+
/**
|
|
1091
|
+
* Glob patterns of files to be checked.
|
|
1092
|
+
*
|
|
1093
|
+
* Glob patterns are relative to the `globRoot` of the configuration file that defines them.
|
|
1094
|
+
*/
|
|
1095
|
+
files?: Glob[];
|
|
1096
|
+
/**
|
|
1097
|
+
* Enable scanning files and directories beginning with `.` (period).
|
|
1098
|
+
*
|
|
1099
|
+
* By default, CSpell does not scan `hidden` files.
|
|
1100
|
+
*
|
|
1101
|
+
* @default false
|
|
1102
|
+
*/
|
|
1103
|
+
enableGlobDot?: boolean;
|
|
1104
|
+
/**
|
|
1105
|
+
* Glob patterns of files to be ignored.
|
|
1106
|
+
*
|
|
1107
|
+
* Glob patterns are relative to the {@link globRoot} of the configuration file that defines them.
|
|
1108
|
+
*/
|
|
1109
|
+
ignorePaths?: Glob[];
|
|
1110
|
+
/**
|
|
1111
|
+
* Prevents searching for local configuration when checking individual documents.
|
|
1112
|
+
*
|
|
1113
|
+
* @default false
|
|
1114
|
+
*/
|
|
1115
|
+
noConfigSearch?: boolean;
|
|
1116
|
+
/**
|
|
1117
|
+
* Indicate that the configuration file should not be modified.
|
|
1118
|
+
* This is used to prevent tools like the VS Code Spell Checker from
|
|
1119
|
+
* modifying the file to add words and other configuration.
|
|
1120
|
+
*
|
|
1121
|
+
* @default false
|
|
1122
|
+
*/
|
|
1123
|
+
readonly?: boolean;
|
|
1124
|
+
/**
|
|
1125
|
+
* Define which reports to use.
|
|
1126
|
+
* `default` - is a special name for the default cli reporter.
|
|
1127
|
+
*
|
|
1128
|
+
* Examples:
|
|
1129
|
+
* - `["default"]` - to use the default reporter
|
|
1130
|
+
* - `["@cspell/cspell-json-reporter"]` - use the cspell JSON reporter.
|
|
1131
|
+
* - `[["@cspell/cspell-json-reporter", { "outFile": "out.json" }]]`
|
|
1132
|
+
* - `[ "default", ["@cspell/cspell-json-reporter", { "outFile": "out.json" }]]` - Use both the default reporter and the cspell-json-reporter.
|
|
1133
|
+
*
|
|
1134
|
+
* @default ["default"]
|
|
1135
|
+
*/
|
|
1136
|
+
reporters?: ReporterSettings[];
|
|
1137
|
+
/**
|
|
1138
|
+
* Tells the spell checker to load `.gitignore` files and skip files that match the globs in the `.gitignore` files found.
|
|
1139
|
+
* @default false
|
|
1140
|
+
*/
|
|
1141
|
+
useGitignore?: boolean;
|
|
1142
|
+
/**
|
|
1143
|
+
* Tells the spell checker to stop searching for `.gitignore` files when it reaches a matching root.
|
|
1144
|
+
*/
|
|
1145
|
+
gitignoreRoot?: FsPath | FsPath[];
|
|
1146
|
+
/**
|
|
1147
|
+
* Verify that the in-document directives are correct.
|
|
1148
|
+
*/
|
|
1149
|
+
validateDirectives?: boolean;
|
|
1150
|
+
/**
|
|
1151
|
+
* Configure CSpell features.
|
|
1152
|
+
*
|
|
1153
|
+
* @since 5.16.0
|
|
1154
|
+
*/
|
|
1155
|
+
features?: Features;
|
|
1156
|
+
}
|
|
1157
|
+
/* eslint-disable no-irregular-whitespace */
|
|
952
1158
|
/**
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1159
|
+
* In the below JSDoc comment, we helpfully specify an example configuration for the end-user to
|
|
1160
|
+
* reference. And this example will get captured by the automatic documentation generator.
|
|
1161
|
+
*
|
|
1162
|
+
* However, specifying the glob pattern inside of a JSDoc is tricky, because the glob contains the
|
|
1163
|
+
* same symbol as the end-of-JSDoc symbol. To work around this, we insert a zero-width space in
|
|
1164
|
+
* between the "*" and the "/" symbols.
|
|
1165
|
+
*/
|
|
960
1166
|
interface ExtendableSettings extends Settings {
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
1167
|
+
/**
|
|
1168
|
+
* Overrides are used to apply settings for specific files in your project.
|
|
1169
|
+
*
|
|
1170
|
+
* For example:
|
|
1171
|
+
*
|
|
1172
|
+
* ```javascript
|
|
1173
|
+
* "overrides": [
|
|
1174
|
+
* // Force `*.hrr` and `*.crr` files to be treated as `cpp` files:
|
|
1175
|
+
* {
|
|
1176
|
+
* "filename": "**/{*.hrr,*.crr}",
|
|
1177
|
+
* "languageId": "cpp"
|
|
1178
|
+
* },
|
|
1179
|
+
* // Force `*.txt` to use the Dutch dictionary (Dutch dictionary needs to be installed separately):
|
|
1180
|
+
* {
|
|
1181
|
+
* "language": "nl",
|
|
1182
|
+
* "filename": "**/dutch/**/*.txt"
|
|
1183
|
+
* }
|
|
1184
|
+
* ]
|
|
1185
|
+
* ```
|
|
1186
|
+
*/
|
|
1187
|
+
overrides?: OverrideSettings[];
|
|
982
1188
|
}
|
|
983
1189
|
interface SpellCheckerExtensionSettings {
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1190
|
+
// * @deprecated true
|
|
1191
|
+
// * @deprecationMessage - Use {@link Settings.enabledFileTypes} instead.
|
|
1192
|
+
/**
|
|
1193
|
+
* Specify a list of file types to spell check. It is better to use {@link Settings.enabledFileTypes} to Enable / Disable checking files types.
|
|
1194
|
+
* @title Enabled Language Ids
|
|
1195
|
+
* @uniqueItems true
|
|
1196
|
+
*/
|
|
1197
|
+
enabledLanguageIds?: LanguageIdSingle[];
|
|
1198
|
+
// * @deprecated true
|
|
1199
|
+
// * @deprecationMessage - Use {@link Settings.enabledFileTypes} instead.
|
|
1200
|
+
/**
|
|
1201
|
+
* Enable / Disable checking file types (languageIds).
|
|
1202
|
+
*
|
|
1203
|
+
* These are in additional to the file types specified by {@link Settings.enabledLanguageIds}.
|
|
1204
|
+
* To disable a language, prefix with `!` as in `!json`,
|
|
1205
|
+
*
|
|
1206
|
+
*
|
|
1207
|
+
* **Example: individual file types**
|
|
1208
|
+
*
|
|
1209
|
+
* ```
|
|
1210
|
+
* jsonc // enable checking for jsonc
|
|
1211
|
+
* !json // disable checking for json
|
|
1212
|
+
* kotlin // enable checking for kotlin
|
|
1213
|
+
* ```
|
|
1214
|
+
*
|
|
1215
|
+
* **Example: enable all file types**
|
|
1216
|
+
*
|
|
1217
|
+
* ```
|
|
1218
|
+
* * // enable checking for all file types
|
|
1219
|
+
* !json // except for json
|
|
1220
|
+
* ```
|
|
1221
|
+
* @title Enable File Types
|
|
1222
|
+
* @scope resource
|
|
1223
|
+
* @uniqueItems true
|
|
1224
|
+
*/
|
|
1225
|
+
enableFiletypes?: LanguageIdSingle[];
|
|
1226
|
+
/**
|
|
1227
|
+
* Enable / Disable checking file types (languageIds).
|
|
1228
|
+
*
|
|
1229
|
+
* This setting replaces: {@link Settings.enabledLanguageIds} and {@link Settings.enableFiletypes}.
|
|
1230
|
+
*
|
|
1231
|
+
* A Value of:
|
|
1232
|
+
* - `true` - enable checking for the file type
|
|
1233
|
+
* - `false` - disable checking for the file type
|
|
1234
|
+
*
|
|
1235
|
+
* A file type of `*` is a wildcard that enables all file types.
|
|
1236
|
+
*
|
|
1237
|
+
* **Example: enable all file types**
|
|
1238
|
+
*
|
|
1239
|
+
* | File Type | Enabled | Comment |
|
|
1240
|
+
* | --------- | ------- | ------- |
|
|
1241
|
+
* | `*` | `true` | Enable all file types. |
|
|
1242
|
+
* | `json` | `false` | Disable checking for json files. |
|
|
1243
|
+
*
|
|
1244
|
+
* @title Enabled File Types to Check
|
|
1245
|
+
* @since 8.8.1
|
|
1246
|
+
*/
|
|
1247
|
+
enabledFileTypes?: Record<string, boolean>;
|
|
1038
1248
|
}
|
|
1039
1249
|
interface Settings extends ReportingConfiguration, BaseSetting, PnPSettings, SpellCheckerExtensionSettings {
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
}
|
|
1069
|
-
interface ReportingConfiguration extends ReporterConfigurationBase, SuggestionsConfiguration {
|
|
1070
|
-
}
|
|
1071
|
-
interface SuggestionsConfiguration {
|
|
1072
|
-
/**
|
|
1073
|
-
* Number of suggestions to make.
|
|
1074
|
-
*
|
|
1075
|
-
* @default 10
|
|
1076
|
-
*/
|
|
1077
|
-
numSuggestions?: number;
|
|
1078
|
-
/**
|
|
1079
|
-
* The maximum amount of time in milliseconds to generate suggestions for a word.
|
|
1080
|
-
*
|
|
1081
|
-
* @default 500
|
|
1082
|
-
*/
|
|
1083
|
-
suggestionsTimeout?: number;
|
|
1084
|
-
/**
|
|
1085
|
-
* The maximum number of changes allowed on a word to be considered a suggestions.
|
|
1086
|
-
*
|
|
1087
|
-
* For example, appending an `s` onto `example` -> `examples` is considered 1 change.
|
|
1088
|
-
*
|
|
1089
|
-
* Range: between 1 and 5.
|
|
1090
|
-
*
|
|
1091
|
-
* @default 3
|
|
1092
|
-
*/
|
|
1093
|
-
suggestionNumChanges?: number;
|
|
1250
|
+
/**
|
|
1251
|
+
* Current active spelling language. This specifies the language locale to use in choosing the
|
|
1252
|
+
* general dictionary.
|
|
1253
|
+
*
|
|
1254
|
+
* For example:
|
|
1255
|
+
*
|
|
1256
|
+
* - "en-GB" for British English.
|
|
1257
|
+
* - "en,nl" to enable both English and Dutch.
|
|
1258
|
+
*
|
|
1259
|
+
* @default "en"
|
|
1260
|
+
*/
|
|
1261
|
+
language?: LocaleId;
|
|
1262
|
+
/**
|
|
1263
|
+
* Additional settings for individual languages.
|
|
1264
|
+
*
|
|
1265
|
+
* See [Language Settings](https://cspell.org/configuration/language-settings/) for more details.
|
|
1266
|
+
*
|
|
1267
|
+
*/
|
|
1268
|
+
languageSettings?: LanguageSetting[];
|
|
1269
|
+
/** Forces the spell checker to assume a give language id. Used mainly as an Override. */
|
|
1270
|
+
languageId?: MatchingFileType;
|
|
1271
|
+
/**
|
|
1272
|
+
* By default, the bundled dictionary configurations are loaded. Explicitly setting this to `false`
|
|
1273
|
+
* will prevent ALL default configuration from being loaded.
|
|
1274
|
+
*
|
|
1275
|
+
* @default true
|
|
1276
|
+
*/
|
|
1277
|
+
loadDefaultConfiguration?: boolean;
|
|
1094
1278
|
}
|
|
1095
1279
|
/**
|
|
1096
|
-
|
|
1097
|
-
|
|
1280
|
+
* Plug N Play settings to support package systems like Yarn 2.
|
|
1281
|
+
*/
|
|
1098
1282
|
interface PnPSettings {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1283
|
+
/**
|
|
1284
|
+
* Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading
|
|
1285
|
+
* packages stored in the repository.
|
|
1286
|
+
*
|
|
1287
|
+
* When true, the spell checker will search up the directory structure for the existence
|
|
1288
|
+
* of a PnP file and load it.
|
|
1289
|
+
*
|
|
1290
|
+
* @default false
|
|
1291
|
+
*/
|
|
1292
|
+
usePnP?: boolean;
|
|
1293
|
+
/**
|
|
1294
|
+
* The PnP files to search for. Note: `.mjs` files are not currently supported.
|
|
1295
|
+
*
|
|
1296
|
+
* @default [".pnp.js", ".pnp.cjs"]
|
|
1297
|
+
*/
|
|
1298
|
+
pnpFiles?: string[];
|
|
1115
1299
|
}
|
|
1116
1300
|
/**
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
type CacheStrategy =
|
|
1123
|
-
type CacheFormat =
|
|
1301
|
+
* The Strategy to use to detect if a file has changed.
|
|
1302
|
+
* - `content` - uses a hash of the file content to check file changes (slower - more accurate).
|
|
1303
|
+
* - `metadata` - uses the file system timestamp and size to detect changes (fastest, may not work in CI).
|
|
1304
|
+
* @default 'content'
|
|
1305
|
+
*/
|
|
1306
|
+
type CacheStrategy = "content" | "metadata";
|
|
1307
|
+
type CacheFormat = "legacy" | "universal";
|
|
1124
1308
|
interface CacheSettings {
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1309
|
+
/**
|
|
1310
|
+
* Store the results of processed files in order to only operate on the changed ones.
|
|
1311
|
+
* @default false
|
|
1312
|
+
*/
|
|
1313
|
+
useCache?: boolean;
|
|
1314
|
+
// cspell:word cspellcache
|
|
1315
|
+
/**
|
|
1316
|
+
* Path to the cache location. Can be a file or a directory.
|
|
1317
|
+
* If none specified `.cspellcache` will be used.
|
|
1318
|
+
* Relative paths are relative to the config file in which it
|
|
1319
|
+
* is defined.
|
|
1320
|
+
*
|
|
1321
|
+
* A prefix of `${cwd}` is replaced with the current working directory.
|
|
1322
|
+
*/
|
|
1323
|
+
cacheLocation?: FSPathResolvable;
|
|
1324
|
+
/**
|
|
1325
|
+
* Strategy to use for detecting changed files, default: metadata
|
|
1326
|
+
* @default 'metadata'
|
|
1327
|
+
*/
|
|
1328
|
+
cacheStrategy?: CacheStrategy;
|
|
1329
|
+
/**
|
|
1330
|
+
* Format of the cache file.
|
|
1331
|
+
* - `legacy` - use absolute paths in the cache file
|
|
1332
|
+
* - `universal` - use a sharable format.
|
|
1333
|
+
* @default 'universal'
|
|
1334
|
+
*/
|
|
1335
|
+
cacheFormat?: CacheFormat | undefined;
|
|
1151
1336
|
}
|
|
1152
1337
|
/**
|
|
1153
|
-
|
|
1154
|
-
|
|
1338
|
+
* These are settings only used by the command line application.
|
|
1339
|
+
*/
|
|
1155
1340
|
interface CommandLineSettings {
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1341
|
+
/**
|
|
1342
|
+
* Define cache settings.
|
|
1343
|
+
*/
|
|
1344
|
+
cache?: CacheSettings;
|
|
1345
|
+
/**
|
|
1346
|
+
* Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks)
|
|
1347
|
+
* @default false
|
|
1348
|
+
*/
|
|
1349
|
+
failFast?: boolean;
|
|
1165
1350
|
}
|
|
1166
1351
|
/**
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1352
|
+
* To prevent the unwanted execution of untrusted code, WorkspaceTrustSettings
|
|
1353
|
+
* are use to set the trust levels.
|
|
1354
|
+
*
|
|
1355
|
+
* Trust setting have an impact on both `cspell.config.js` files and on `.pnp.js` files.
|
|
1356
|
+
* In an untrusted location, these files will NOT be used.
|
|
1357
|
+
*
|
|
1358
|
+
* This will also prevent any associated plugins from being loaded.
|
|
1359
|
+
*/
|
|
1175
1360
|
interface WorkspaceTrustSettings {
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1361
|
+
/**
|
|
1362
|
+
* Glob patterns of locations that contain ALWAYS trusted files.
|
|
1363
|
+
*/
|
|
1364
|
+
trustedFiles?: Glob[];
|
|
1365
|
+
/**
|
|
1366
|
+
* Glob patterns of locations that contain NEVER trusted files.
|
|
1367
|
+
*/
|
|
1368
|
+
untrustedFiles?: Glob[];
|
|
1369
|
+
/**
|
|
1370
|
+
* Sets the default trust level.
|
|
1371
|
+
* @default "trusted"
|
|
1372
|
+
*/
|
|
1373
|
+
trustLevel?: TrustLevel;
|
|
1189
1374
|
}
|
|
1190
1375
|
/**
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1376
|
+
* VS Code Spell Checker Settings.
|
|
1377
|
+
* To be Removed.
|
|
1378
|
+
* @deprecated true
|
|
1379
|
+
*/
|
|
1195
1380
|
interface LegacySettings {
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1381
|
+
/**
|
|
1382
|
+
* Show status.
|
|
1383
|
+
* @deprecated true
|
|
1384
|
+
*/
|
|
1385
|
+
showStatus?: boolean;
|
|
1386
|
+
/**
|
|
1387
|
+
* Delay in ms after a document has changed before checking it for spelling errors.
|
|
1388
|
+
* @deprecated true
|
|
1389
|
+
*/
|
|
1390
|
+
spellCheckDelayMs?: number;
|
|
1206
1391
|
}
|
|
1207
1392
|
interface OverrideSettings extends Settings, OverrideFilterFields {
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1393
|
+
/** Sets the programming language id to match file type. */
|
|
1394
|
+
languageId?: MatchingFileType;
|
|
1395
|
+
/** Sets the locale. */
|
|
1396
|
+
language?: LocaleId;
|
|
1212
1397
|
}
|
|
1213
1398
|
interface OverrideFilterFields {
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
}
|
|
1217
|
-
interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings {
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
}
|
|
1345
|
-
interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {
|
|
1346
|
-
}
|
|
1347
|
-
interface LanguageSettingFilterFields extends LanguageSettingFilterFieldsPreferred, LanguageSettingFilterFieldsDeprecated {
|
|
1348
|
-
}
|
|
1399
|
+
/** Glob pattern or patterns to match against. */
|
|
1400
|
+
filename: Glob | Glob[];
|
|
1401
|
+
}
|
|
1402
|
+
interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings, UnknownWordsConfiguration {
|
|
1403
|
+
/** Optional identifier. */
|
|
1404
|
+
id?: string;
|
|
1405
|
+
/** Optional name of configuration. */
|
|
1406
|
+
name?: string;
|
|
1407
|
+
/** Optional description of configuration. */
|
|
1408
|
+
description?: string;
|
|
1409
|
+
/**
|
|
1410
|
+
* Is the spell checker enabled.
|
|
1411
|
+
* @default true
|
|
1412
|
+
*/
|
|
1413
|
+
enabled?: boolean;
|
|
1414
|
+
/**
|
|
1415
|
+
* True to enable compound word checking.
|
|
1416
|
+
*
|
|
1417
|
+
* @default false
|
|
1418
|
+
*/
|
|
1419
|
+
allowCompoundWords?: boolean;
|
|
1420
|
+
/**
|
|
1421
|
+
* Determines if words must match case and accent rules.
|
|
1422
|
+
*
|
|
1423
|
+
* See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.
|
|
1424
|
+
*
|
|
1425
|
+
* - `false` - Case is ignored and accents can be missing on the entire word.
|
|
1426
|
+
* Incorrect accents or partially missing accents will be marked as incorrect.
|
|
1427
|
+
* - `true` - Case and accents are enforced.
|
|
1428
|
+
*
|
|
1429
|
+
* @default false
|
|
1430
|
+
*/
|
|
1431
|
+
caseSensitive?: boolean;
|
|
1432
|
+
/**
|
|
1433
|
+
* Define additional available dictionaries.
|
|
1434
|
+
*
|
|
1435
|
+
* For example, you can use the following to add a custom dictionary:
|
|
1436
|
+
*
|
|
1437
|
+
* ```json
|
|
1438
|
+
* "dictionaryDefinitions": [
|
|
1439
|
+
* { "name": "custom-words", "path": "./custom-words.txt"}
|
|
1440
|
+
* ],
|
|
1441
|
+
* "dictionaries": ["custom-words"]
|
|
1442
|
+
* ```
|
|
1443
|
+
*/
|
|
1444
|
+
dictionaryDefinitions?: DictionaryDefinition[];
|
|
1445
|
+
/**
|
|
1446
|
+
* Optional list of dictionaries to use. Each entry should match the name of the dictionary.
|
|
1447
|
+
*
|
|
1448
|
+
* To remove a dictionary from the list, add `!` before the name.
|
|
1449
|
+
*
|
|
1450
|
+
* For example, `!typescript` will turn off the dictionary with the name `typescript`.
|
|
1451
|
+
*
|
|
1452
|
+
* See the [Dictionaries](https://cspell.org/docs/dictionaries/)
|
|
1453
|
+
* and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.
|
|
1454
|
+
*/
|
|
1455
|
+
dictionaries?: DictionaryReference[];
|
|
1456
|
+
/**
|
|
1457
|
+
* Optional list of dictionaries that will not be used for suggestions.
|
|
1458
|
+
* Words in these dictionaries are considered correct, but will not be
|
|
1459
|
+
* used when making spell correction suggestions.
|
|
1460
|
+
*
|
|
1461
|
+
* Note: if a word is suggested by another dictionary, but found in
|
|
1462
|
+
* one of these dictionaries, it will be removed from the set of
|
|
1463
|
+
* possible suggestions.
|
|
1464
|
+
*/
|
|
1465
|
+
noSuggestDictionaries?: DictionaryReference[];
|
|
1466
|
+
/**
|
|
1467
|
+
* List of regular expression patterns or pattern names to exclude from spell checking.
|
|
1468
|
+
*
|
|
1469
|
+
* Example: `["href"]` - to exclude html href pattern.
|
|
1470
|
+
*
|
|
1471
|
+
* Regular expressions use JavaScript regular expression syntax.
|
|
1472
|
+
*
|
|
1473
|
+
* Example: to ignore ALL-CAPS words
|
|
1474
|
+
*
|
|
1475
|
+
* JSON
|
|
1476
|
+
* ```json
|
|
1477
|
+
* "ignoreRegExpList": ["/\\b[A-Z]+\\b/g"]
|
|
1478
|
+
* ```
|
|
1479
|
+
*
|
|
1480
|
+
* YAML
|
|
1481
|
+
* ```yaml
|
|
1482
|
+
* ignoreRegExpList:
|
|
1483
|
+
* - >-
|
|
1484
|
+
* /\b[A-Z]+\b/g
|
|
1485
|
+
* ```
|
|
1486
|
+
*
|
|
1487
|
+
* By default, several patterns are excluded. See
|
|
1488
|
+
* [Configuration](https://cspell.org/configuration/patterns) for more details.
|
|
1489
|
+
*
|
|
1490
|
+
* While you can create your own patterns, you can also leverage several patterns that are
|
|
1491
|
+
* [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).
|
|
1492
|
+
*/
|
|
1493
|
+
ignoreRegExpList?: RegExpPatternList;
|
|
1494
|
+
/**
|
|
1495
|
+
* List of regular expression patterns or defined pattern names to match for spell checking.
|
|
1496
|
+
*
|
|
1497
|
+
* If this property is defined, only text matching the included patterns will be checked.
|
|
1498
|
+
*
|
|
1499
|
+
* While you can create your own patterns, you can also leverage several patterns that are
|
|
1500
|
+
* [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).
|
|
1501
|
+
*/
|
|
1502
|
+
includeRegExpList?: RegExpPatternList;
|
|
1503
|
+
/**
|
|
1504
|
+
* Defines a list of patterns that can be used with the {@link ignoreRegExpList} and
|
|
1505
|
+
* {@link includeRegExpList} options.
|
|
1506
|
+
*
|
|
1507
|
+
* For example:
|
|
1508
|
+
*
|
|
1509
|
+
* ```javascript
|
|
1510
|
+
* "ignoreRegExpList": ["comments"],
|
|
1511
|
+
* "patterns": [
|
|
1512
|
+
* {
|
|
1513
|
+
* "name": "comment-single-line",
|
|
1514
|
+
* "pattern": "/#.*/g"
|
|
1515
|
+
* },
|
|
1516
|
+
* {
|
|
1517
|
+
* "name": "comment-multi-line",
|
|
1518
|
+
* "pattern": "/(?:\\/\\*[\\s\\S]*?\\*\\/)/g"
|
|
1519
|
+
* },
|
|
1520
|
+
* // You can also combine multiple named patterns into one single named pattern
|
|
1521
|
+
* {
|
|
1522
|
+
* "name": "comments",
|
|
1523
|
+
* "pattern": ["comment-single-line", "comment-multi-line"]
|
|
1524
|
+
* }
|
|
1525
|
+
* ]
|
|
1526
|
+
* ```
|
|
1527
|
+
*/
|
|
1528
|
+
patterns?: RegExpPatternDefinition[];
|
|
1529
|
+
}
|
|
1530
|
+
interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {}
|
|
1531
|
+
interface LanguageSettingFilterFields extends LanguageSettingFilterFieldsPreferred, LanguageSettingFilterFieldsDeprecated {}
|
|
1349
1532
|
interface LanguageSettingFilterFieldsPreferred {
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1533
|
+
/** The language id. Ex: `typescript`, `html`, or `php`. `*` -- will match all languages. */
|
|
1534
|
+
languageId: MatchingFileType;
|
|
1535
|
+
/** The locale filter, matches against the language. This can be a comma separated list. `*` will match all locales. */
|
|
1536
|
+
locale?: LocaleId | LocaleId[];
|
|
1354
1537
|
}
|
|
1355
1538
|
interface LanguageSettingFilterFieldsDeprecated {
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1539
|
+
/** The language id. Ex: `typescript`, `html`, or `php`. `*` -- will match all languages. */
|
|
1540
|
+
languageId: MatchingFileType;
|
|
1541
|
+
/**
|
|
1542
|
+
* Deprecated - The locale filter, matches against the language. This can be a comma separated list. `*` will match all locales.
|
|
1543
|
+
* @deprecated true
|
|
1544
|
+
* @deprecationMessage Use `locale` instead.
|
|
1545
|
+
*/
|
|
1546
|
+
local?: LocaleId | LocaleId[];
|
|
1364
1547
|
}
|
|
1365
1548
|
/** @hidden */
|
|
1366
1549
|
type InternalRegExp = RegExp;
|
|
1367
1550
|
type Pattern = string | InternalRegExp;
|
|
1368
|
-
type PredefinedPatterns =
|
|
1551
|
+
type PredefinedPatterns = "Base64" | "Base64MultiLine" | "Base64SingleLine" | "CStyleComment" | "CStyleHexValue" | "CSSHexValue" | "CommitHash" | "CommitHashLink" | "Email" | "EscapeCharacters" | "HexValues" | "href" | "PhpHereDoc" | "PublicKey" | "RsaCert" | "SshRsa" | "SHA" | "HashStrings" | "SpellCheckerDisable" | "SpellCheckerDisableBlock" | "SpellCheckerDisableLine" | "SpellCheckerDisableNext" | "SpellCheckerIgnoreInDocSetting" | "string" | "UnicodeRef" | "Urls" | "UUID" | "Everything";
|
|
1369
1552
|
/** This matches the name in a pattern definition. */
|
|
1370
1553
|
type PatternId = string;
|
|
1371
1554
|
/** A PatternRef is a Pattern or PatternId. */
|
|
@@ -1375,249 +1558,250 @@ type RegExpPatternList = PatternRef[];
|
|
|
1375
1558
|
/** This is a written language locale like: `en`, `en-GB`, `fr`, `es`, `de` or `en,fr` for both English and French */
|
|
1376
1559
|
type LocaleId = string;
|
|
1377
1560
|
/**
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
type VersionLatest =
|
|
1561
|
+
* Configuration File Version.
|
|
1562
|
+
*/
|
|
1563
|
+
type VersionLatest = "0.2";
|
|
1381
1564
|
/**
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
type VersionLegacy =
|
|
1565
|
+
* Legacy Configuration File Versions.
|
|
1566
|
+
* @deprecated true
|
|
1567
|
+
* @deprecationMessage Use `0.2` instead.
|
|
1568
|
+
*/
|
|
1569
|
+
type VersionLegacy = "0.1";
|
|
1387
1570
|
type Version = VersionLatest | VersionLegacy;
|
|
1388
1571
|
/**
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1572
|
+
* @deprecated true
|
|
1573
|
+
* @deprecationMessage Use `LocaleId` instead.
|
|
1574
|
+
*/
|
|
1392
1575
|
type LocalId = LocaleId;
|
|
1393
1576
|
/** These are glob expressions. */
|
|
1394
1577
|
type Glob = SimpleGlob | GlobDef;
|
|
1395
1578
|
/** Simple Glob string, the root will be globRoot. */
|
|
1396
1579
|
type SimpleGlob = string;
|
|
1397
1580
|
/**
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1581
|
+
* Used to define fully qualified glob patterns.
|
|
1582
|
+
* It is currently hidden to make the json-schema a bit easier to use
|
|
1583
|
+
* when crafting cspell.json files by hand.
|
|
1584
|
+
* @hidden
|
|
1585
|
+
*/
|
|
1403
1586
|
interface GlobDef {
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1587
|
+
/** Glob pattern to match. */
|
|
1588
|
+
glob: string;
|
|
1589
|
+
/** Optional root to use when matching the glob. Defaults to current working dir. */
|
|
1590
|
+
root?: string;
|
|
1591
|
+
/**
|
|
1592
|
+
* Optional source of the glob, used when merging settings to determine the origin.
|
|
1593
|
+
* @hidden
|
|
1594
|
+
*/
|
|
1595
|
+
source?: string;
|
|
1413
1596
|
}
|
|
1414
1597
|
/**
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1598
|
+
* A file type:
|
|
1599
|
+
* - `*` - will match ALL file types.
|
|
1600
|
+
* - `typescript`, `cpp`, `json`, etc.
|
|
1601
|
+
* @pattern ^(!?[-\w_\s]+)|(\*)$
|
|
1602
|
+
*/
|
|
1420
1603
|
type LanguageIdSingle = string;
|
|
1421
1604
|
/**
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1605
|
+
* A single string with a comma separated list of file types:
|
|
1606
|
+
* - `typescript,cpp`
|
|
1607
|
+
* - `json,jsonc,yaml`
|
|
1608
|
+
* - etc.
|
|
1609
|
+
* @pattern ^([-\w_\s]+)(,[-\w_\s]+)*$
|
|
1610
|
+
*/
|
|
1428
1611
|
type LanguageIdMultiple = string;
|
|
1429
1612
|
/**
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1613
|
+
* A Negative File Type used to exclude files of that type.
|
|
1614
|
+
* - `!typescript` - will exclude typescript files.
|
|
1615
|
+
* - `!cpp,!json` - will exclude cpp and json files.
|
|
1616
|
+
* - `!typescript,javascript` - will exclude typescript files and include javascript files.
|
|
1617
|
+
* @pattern ^(![-\w_\s]+)(,!?[-\w_\s]+)*$
|
|
1618
|
+
*/
|
|
1436
1619
|
type LanguageIdMultipleNeg = string;
|
|
1437
1620
|
type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
|
|
1438
1621
|
type MatchingFileType = LanguageId | LanguageId[];
|
|
1439
1622
|
/**
|
|
1440
|
-
|
|
1441
|
-
|
|
1623
|
+
* A File System Path. Relative paths are relative to the configuration file.
|
|
1624
|
+
*/
|
|
1442
1625
|
type FsPath = string;
|
|
1443
1626
|
/**
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1627
|
+
* A File System Path.
|
|
1628
|
+
*
|
|
1629
|
+
* Special Properties:
|
|
1630
|
+
* - `${cwd}` prefix - will be replaced with the current working directory.
|
|
1631
|
+
* - Relative paths are relative to the configuration file.
|
|
1632
|
+
*/
|
|
1450
1633
|
type FSPathResolvable = FsPath;
|
|
1451
1634
|
/** Trust Security Level. */
|
|
1452
|
-
type TrustLevel =
|
|
1635
|
+
type TrustLevel = "trusted" | "untrusted";
|
|
1453
1636
|
interface RegExpPatternDefinition {
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1637
|
+
/**
|
|
1638
|
+
* Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList.
|
|
1639
|
+
* It is possible to redefine one of the predefined patterns to override its value.
|
|
1640
|
+
*/
|
|
1641
|
+
name: PatternId;
|
|
1642
|
+
/**
|
|
1643
|
+
* RegExp pattern or array of RegExp patterns.
|
|
1644
|
+
*/
|
|
1645
|
+
pattern: Pattern | Pattern[];
|
|
1646
|
+
/**
|
|
1647
|
+
* Description of the pattern.
|
|
1648
|
+
*/
|
|
1649
|
+
description?: string | undefined;
|
|
1467
1650
|
}
|
|
1468
1651
|
type CSpellUserSettingsWithComments = CSpellUserSettings;
|
|
1652
|
+
// Remove BaseSource from the Source list when the code is ready.
|
|
1469
1653
|
type Source = FileSource | MergeSource | InMemorySource | BaseSource;
|
|
1470
1654
|
interface FileSource extends BaseSource {
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1655
|
+
/** Name of source. */
|
|
1656
|
+
name: string;
|
|
1657
|
+
/** Filename if this came from a file. */
|
|
1658
|
+
filename: string;
|
|
1659
|
+
/** The two settings that were merged to. */
|
|
1660
|
+
sources?: undefined;
|
|
1661
|
+
/** The configuration read. */
|
|
1662
|
+
fileSource: CSpellSettings;
|
|
1479
1663
|
}
|
|
1480
1664
|
interface MergeSource extends BaseSource {
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1665
|
+
/** Name of source. */
|
|
1666
|
+
name: string;
|
|
1667
|
+
/** Filename if this came from a file. */
|
|
1668
|
+
filename?: undefined;
|
|
1669
|
+
/** The two settings that were merged to. */
|
|
1670
|
+
sources: [CSpellSettings] | [CSpellSettings, CSpellSettings];
|
|
1671
|
+
/** The configuration read. */
|
|
1672
|
+
fileSource?: undefined;
|
|
1489
1673
|
}
|
|
1490
1674
|
interface InMemorySource extends BaseSource {
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1675
|
+
/** Name of source. */
|
|
1676
|
+
name: string;
|
|
1677
|
+
/** Filename if this came from a file. */
|
|
1678
|
+
filename?: undefined;
|
|
1679
|
+
/** The two settings that were merged to. */
|
|
1680
|
+
sources?: undefined;
|
|
1681
|
+
/** The configuration read. */
|
|
1682
|
+
fileSource?: undefined;
|
|
1499
1683
|
}
|
|
1500
1684
|
interface BaseSource {
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1685
|
+
/** Name of source. */
|
|
1686
|
+
name: string;
|
|
1687
|
+
/** Filename if this came from a file. */
|
|
1688
|
+
filename?: string | undefined;
|
|
1689
|
+
/** The two settings that were merged to. */
|
|
1690
|
+
sources?: [CSpellSettings] | [CSpellSettings, CSpellSettings] | undefined;
|
|
1691
|
+
/** The configuration read. */
|
|
1692
|
+
fileSource?: CSpellSettings | undefined;
|
|
1509
1693
|
}
|
|
1510
1694
|
/**
|
|
1511
|
-
|
|
1512
|
-
|
|
1695
|
+
* The module or path to the the reporter to load.
|
|
1696
|
+
*/
|
|
1513
1697
|
type ReporterModuleName = string;
|
|
1514
1698
|
/**
|
|
1515
|
-
|
|
1516
|
-
|
|
1699
|
+
* Options to send to the reporter. These are defined by the reporter.
|
|
1700
|
+
*/
|
|
1517
1701
|
type ReporterOptions = Serializable;
|
|
1518
1702
|
/**
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1703
|
+
* Declare a reporter to use.
|
|
1704
|
+
*
|
|
1705
|
+
* `default` - is a special name for the default cli reporter.
|
|
1706
|
+
*
|
|
1707
|
+
* Examples:
|
|
1708
|
+
* - `"default"` - to use the default reporter
|
|
1709
|
+
* - `"@cspell/cspell-json-reporter"` - use the cspell JSON reporter.
|
|
1710
|
+
* - `["@cspell/cspell-json-reporter", { "outFile": "out.json" }]`
|
|
1711
|
+
*/
|
|
1528
1712
|
type ReporterSettings = ReporterModuleName | [name: ReporterModuleName] | [name: ReporterModuleName, options: ReporterOptions];
|
|
1529
1713
|
/**
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1714
|
+
* Experimental Configuration / Options
|
|
1715
|
+
*
|
|
1716
|
+
* This Configuration is subject to change without warning.
|
|
1717
|
+
* @experimental
|
|
1718
|
+
* @hidden
|
|
1719
|
+
*/
|
|
1536
1720
|
interface ExperimentalFileSettings {
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1721
|
+
/**
|
|
1722
|
+
* Future Plugin support
|
|
1723
|
+
* @experimental
|
|
1724
|
+
* @since 6.2.0
|
|
1725
|
+
*/
|
|
1726
|
+
plugins?: Plugin[];
|
|
1543
1727
|
}
|
|
1544
1728
|
/**
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
interface AdvancedCSpellSettings extends CSpellSettings, ExperimentalFileSettings {
|
|
1550
|
-
}
|
|
1729
|
+
* Extends CSpellSettings with {@link ExperimentalFileSettings}
|
|
1730
|
+
* @experimental
|
|
1731
|
+
* @hidden
|
|
1732
|
+
*/
|
|
1733
|
+
interface AdvancedCSpellSettings extends CSpellSettings, ExperimentalFileSettings {}
|
|
1551
1734
|
/**
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1735
|
+
* Experimental Configuration / Options
|
|
1736
|
+
*
|
|
1737
|
+
* This Configuration is subject to change without warning.
|
|
1738
|
+
* @experimental
|
|
1739
|
+
* @hidden
|
|
1740
|
+
*/
|
|
1558
1741
|
interface ExperimentalBaseSettings {
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1742
|
+
/**
|
|
1743
|
+
* Parser to use for the file content
|
|
1744
|
+
* @experimental
|
|
1745
|
+
* @since 6.2.0
|
|
1746
|
+
*/
|
|
1747
|
+
parser?: ParserName;
|
|
1565
1748
|
}
|
|
1566
1749
|
/**
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1750
|
+
* Plugin API
|
|
1751
|
+
* @experimental
|
|
1752
|
+
* @since 6.2.0
|
|
1753
|
+
*/
|
|
1571
1754
|
interface Plugin {
|
|
1572
|
-
|
|
1755
|
+
parsers?: Parser[];
|
|
1573
1756
|
}
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
type
|
|
1577
|
-
|
|
1578
|
-
};
|
|
1757
|
+
//#endregion
|
|
1758
|
+
//#region src/configFields.d.ts
|
|
1759
|
+
type ConfigKeys = Exclude<keyof CSpellUserSettings, "$schema" | "version" | "id">;
|
|
1760
|
+
type CSpellUserSettingsFields = { [key in ConfigKeys]: key };
|
|
1579
1761
|
declare const ConfigFields: CSpellUserSettingsFields;
|
|
1580
|
-
|
|
1762
|
+
//#endregion
|
|
1763
|
+
//#region src/defaultConfigSettings.d.ts
|
|
1581
1764
|
declare const defaultCSpellSettings: {
|
|
1582
|
-
|
|
1583
|
-
|
|
1765
|
+
readonly ignoreRandomStrings: boolean;
|
|
1766
|
+
readonly minRandomLength: number;
|
|
1584
1767
|
};
|
|
1585
|
-
|
|
1768
|
+
//#endregion
|
|
1769
|
+
//#region src/defineConfig.d.ts
|
|
1586
1770
|
declare function defineConfig(config: CSpellSettings): CSpellSettings;
|
|
1587
|
-
|
|
1771
|
+
//#endregion
|
|
1772
|
+
//#region src/TextMap.d.ts
|
|
1588
1773
|
type MappedText = Readonly<TransformedText>;
|
|
1589
1774
|
type Range = readonly [start: number, end: number];
|
|
1590
1775
|
interface Mapped {
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1776
|
+
/**
|
|
1777
|
+
* `(i, j)` number pairs where
|
|
1778
|
+
* - `i` is the offset in the source
|
|
1779
|
+
* - `j` is the offset in the destination
|
|
1780
|
+
*
|
|
1781
|
+
* Example:
|
|
1782
|
+
* - source text = `"caf\xe9"`
|
|
1783
|
+
* - mapped text = `"café"`
|
|
1784
|
+
* - map = `[3, 3, 7, 4]`, which is equivalent to `[0, 0, 3, 3, 7, 4]`
|
|
1785
|
+
* where the `[0, 0]` is unnecessary.
|
|
1786
|
+
*
|
|
1787
|
+
*/
|
|
1788
|
+
map: number[];
|
|
1604
1789
|
}
|
|
1605
1790
|
interface TransformedText extends PartialOrUndefined<Mapped> {
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
}
|
|
1619
|
-
type PartialOrUndefined<T> = {
|
|
1620
|
-
|
|
1621
|
-
};
|
|
1622
|
-
|
|
1623
|
-
export { type AdvancedCSpellSettings, type AdvancedCSpellSettingsWithSourceTrace, type BaseSetting, type CSpellPackageSettings, type CSpellReporter, type CSpellReporterModule, type CSpellSettings, type CSpellSettingsWithSourceTrace, type CSpellUserSettings, type CSpellUserSettingsFields, type CSpellUserSettingsWithComments, type CacheFormat, type CacheSettings, type CacheStrategy, type CharacterSet, type CharacterSetCosts, type CommandLineSettings, ConfigFields, type CustomDictionaryPath, type CustomDictionaryScope, type DebugEmitter, type DictionaryDefinition, type DictionaryDefinitionAlternate, type DictionaryDefinitionAugmented, type DictionaryDefinitionBase, type DictionaryDefinitionCustom, type DictionaryDefinitionInline, type DictionaryDefinitionInlineFlagWords, type DictionaryDefinitionInlineIgnoreWords, type DictionaryDefinitionInlineWords, type DictionaryDefinitionLegacy, type DictionaryDefinitionPreferred, type DictionaryFileTypes, type DictionaryId, type DictionaryInformation, type DictionaryNegRef, type DictionaryPath, type DictionaryRef, type DictionaryReference, type EditCosts, type ErrorEmitter, type ErrorLike, type ExperimentalBaseSettings, type ExperimentalFileSettings, type ExtendableSettings, type FSPathResolvable, type Feature, type Features, type FileSettings, type FileSource, type FsPath, type Glob, type GlobDef, type ImportFileRef, type InMemorySource, type Issue, IssueType, type LanguageId, type LanguageIdMultiple, type LanguageIdMultipleNeg, type LanguageIdSingle, type LanguageSetting, type LanguageSettingFilterFields, type LanguageSettingFilterFieldsDeprecated, type LanguageSettingFilterFieldsPreferred, type LegacySettings, type LocalId, type LocaleId, type MappedText, type MatchingFileType, type MergeSource, type MessageEmitter, type MessageType, type MessageTypeLookup, MessageTypes, type OverrideFilterFields, type OverrideSettings, Parser, ParserName, type Pattern, type PatternId, type PatternRef, type Plugin, type PnPSettings, type PredefinedPatterns, type ProgressBase, type ProgressEmitter, type ProgressFileBase, type ProgressFileBegin, type ProgressFileComplete, type ProgressItem, type ProgressTypes, type RegExpPatternDefinition, type RegExpPatternList, type ReplaceEntry, type ReplaceMap, type ReporterConfiguration, type ReporterSettings, type ReportingConfiguration, type ResultEmitter, type RunResult, type Settings, type SimpleGlob, type Source, type SpellingErrorEmitter, type SuggestionCostMapDef, type SuggestionCostsDefs, type SuggestionsConfiguration, type TextDocumentOffset, type TextOffset, type TrustLevel, type Version, type VersionLatest, type VersionLegacy, type WorkspaceTrustSettings, defaultCSpellSettings, defineConfig };
|
|
1791
|
+
/**
|
|
1792
|
+
* Transformed text with an optional map.
|
|
1793
|
+
*/
|
|
1794
|
+
text: string;
|
|
1795
|
+
/**
|
|
1796
|
+
* The original text
|
|
1797
|
+
*/
|
|
1798
|
+
rawText?: string | undefined;
|
|
1799
|
+
/**
|
|
1800
|
+
* The start and end offset of the text in the document.
|
|
1801
|
+
*/
|
|
1802
|
+
range: Range;
|
|
1803
|
+
}
|
|
1804
|
+
type PartialOrUndefined<T> = { [P in keyof T]?: T[P] | undefined };
|
|
1805
|
+
//#endregion
|
|
1806
|
+
export { AdvancedCSpellSettings, AdvancedCSpellSettingsWithSourceTrace, BaseSetting, CSpellPackageSettings, CSpellReporter, CSpellReporterEmitters, CSpellReporterModule, CSpellSettings, CSpellSettingsWithSourceTrace, CSpellUserSettings, CSpellUserSettingsFields, CSpellUserSettingsWithComments, CacheFormat, CacheSettings, CacheStrategy, CharacterSet, CharacterSetCosts, CommandLineSettings, ConfigFields, CustomDictionaryPath, CustomDictionaryScope, DebugEmitter, DictionaryDefinition, DictionaryDefinitionAlternate, DictionaryDefinitionAugmented, DictionaryDefinitionBase, DictionaryDefinitionCustom, DictionaryDefinitionInline, DictionaryDefinitionInlineFlagWords, DictionaryDefinitionInlineIgnoreWords, DictionaryDefinitionInlineWords, DictionaryDefinitionLegacy, DictionaryDefinitionPreferred, DictionaryDefinitionSimple, DictionaryFileTypes, DictionaryId, DictionaryInformation, DictionaryNegRef, DictionaryPath, DictionaryRef, DictionaryReference, EditCosts, ErrorEmitter, ErrorLike, ExperimentalBaseSettings, ExperimentalFileSettings, ExtendableSettings, FSPathResolvable, Feature, Features, FeaturesSupportedByReporter, FileSettings, FileSource, FsPath, Glob, GlobDef, ImportFileRef, InMemorySource, Issue, IssueType, LanguageId, LanguageIdMultiple, LanguageIdMultipleNeg, LanguageIdSingle, LanguageSetting, LanguageSettingFilterFields, LanguageSettingFilterFieldsDeprecated, LanguageSettingFilterFieldsPreferred, LegacySettings, LocalId, LocaleId, MappedText, MatchingFileType, MergeSource, MessageEmitter, MessageType, MessageTypeLookup, MessageTypes, OverrideFilterFields, OverrideSettings, ParseResult, ParsedText, Parser, ParserName, ParserOptions, Pattern, PatternId, PatternRef, Plugin, PnPSettings, PredefinedPatterns, ProgressBase, ProgressEmitter, ProgressFileBase, ProgressFileBegin, ProgressFileComplete, ProgressItem, ProgressTypes, RegExpPatternDefinition, RegExpPatternList, ReplaceEntry, ReplaceMap, ReportIssueOptions, ReporterConfiguration, ReporterSettings, ReportingConfiguration, ResultEmitter, RunResult, Settings, SimpleGlob, Source, SpellingErrorEmitter, SuggestionCostMapDef, SuggestionCostsDefs, SuggestionsConfiguration, TextDocumentOffset, TextOffset, TrustLevel, UnknownWordsChoices, UnknownWordsConfiguration, Version, VersionLatest, VersionLegacy, WorkspaceTrustSettings, defaultCSpellSettings, defineConfig, unknownWordsChoices };
|
|
1807
|
+
//# sourceMappingURL=index.d.ts.map
|