-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
CSpellSettingsDef.ts
853 lines (735 loc) · 23.9 KB
/
CSpellSettingsDef.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
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
327
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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
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
418
419
420
421
422
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
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
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
534
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
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
import type { DictionaryInformation } from './DictionaryInformation';
import type { Features } from './features';
export type ReplaceEntry = [string, string];
export type ReplaceMap = ReplaceEntry[];
/**
* These settings come from user and workspace settings.
*/
export type CSpellPackageSettings = CSpellUserSettings;
export type CSpellUserSettings = CSpellSettings;
export interface CSpellSettings extends FileSettings, LegacySettings {
/**
* Url to JSON Schema
* @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json"
*/
$schema?: string;
}
export interface ImportFileRef {
filename: string;
error?: Error | undefined;
referencedBy?: Source[];
}
export interface CSpellSettingsWithSourceTrace extends CSpellSettings {
source?: Source | undefined;
__importRef?: ImportFileRef;
__imports?: Map<string, ImportFileRef>;
}
export interface FileSettings extends ExtendableSettings, CommandLineSettings {
/**
* Configuration format version of the settings file.
* @default "0.2"
*/
version?: Version;
/** Words to add to global dictionary -- should only be in the user config file. */
userWords?: string[];
/** Other settings files to be included. */
import?: FsPath | FsPath[];
/**
* The root to use for glob patterns found in this configuration.
* Default: location of the configuration file.
* For compatibility reasons, config files with version 0.1, the glob root will
* default to be `${cwd}`.
*
* Use `globRoot` to define a different location.
* `globRoot` can be relative to the location of this configuration file.
* Defining globRoot, does not impact imported configurations.
*
* Special Values:
* - `${cwd}` - will be replaced with the current working directory.
* - `.` - will be the location of the containing configuration file.
*
*/
globRoot?: FSPathResolvable;
/**
* Glob patterns of files to be checked.
* Glob patterns are relative to the `globRoot` of the configuration file that defines them.
*/
files?: Glob[];
/**
* Enable scanning files and directories beginning with `.` (period).
* By default, CSpell does not scan `hidden` files.
*
* @default false
*/
enableGlobDot?: boolean;
/**
* Glob patterns of files to be ignored.
* Glob patterns are relative to the `globRoot` of the configuration file that defines them.
*/
ignorePaths?: Glob[];
/**
* Prevents searching for local configuration when checking individual documents.
* @default false
*/
noConfigSearch?: boolean;
/**
* Indicate that the configuration file should not be modified.
* This is used to prevent tools like the VS Code Spell Checker from
* modifying the file to add words and other configuration.
* @default false
*/
readonly?: boolean;
/**
* Custom reporters configuration.
*/
reporters?: ReporterSettings[];
/**
* Tells the spell checker to load `.gitignore` files and skip files that match the globs in the `.gitignore` files found.
* @default false
*/
useGitignore?: boolean;
/**
* Tells the spell checker to searching for `.gitignore` files when it reaches a matching root.
*/
gitignoreRoot?: FsPath | FsPath[];
/**
* Configure CSpell features.
*
* - Added with `v5.16.0`.
*/
features?: Features;
}
export interface ExtendableSettings extends Settings {
/** Overrides to apply based upon the file path. */
overrides?: OverrideSettings[];
}
export interface Settings extends ReportingConfiguration, BaseSetting, PnPSettings {
/**
* Current active spelling language.
*
* Example: "en-GB" for British English.
*
* Example: "en,nl" to enable both English and Dutch.
* @default "en"
*/
language?: LocaleId;
/** languageIds for the files to spell check. */
enabledLanguageIds?: LanguageIdSingle[];
/**
* @title File Types to Check
* @scope resource
* @uniqueItems true
* @markdownDescription
* Enable / Disable checking file types (languageIds).
* These are in additional to the file types specified by `cSpell.enabledLanguageIds`.
* To disable a language, prefix with `!` as in `!json`,
*
* Example:
* ```
* jsonc // enable checking for jsonc
* !json // disable checking for json
* kotlin // enable checking for kotlin
* ```
*/
enableFiletypes?: LanguageIdSingle[];
/** Additional settings for individual languages. */
languageSettings?: LanguageSetting[];
/** Forces the spell checker to assume a give language id. Used mainly as an Override. */
languageId?: LanguageId;
/**
* By default, the bundled dictionary configurations are loaded. Explicitly setting this to `false`
* will prevent ALL default configuration from being loaded.
* @default true
*/
loadDefaultConfiguration?: boolean;
}
export interface ReportingConfiguration extends SuggestionsConfiguration {
/**
* The maximum number of problems to report in a file.
* @default 100
*/
maxNumberOfProblems?: number;
/**
* The maximum number of times the same word can be flagged as an error in a file.
* @default 5
*/
maxDuplicateProblems?: number;
/**
* The minimum length of a word before checking it against a dictionary.
* @default 4
*/
minWordLength?: number;
}
export interface SuggestionsConfiguration {
/**
* Number of suggestions to make.
* @default 10
*/
numSuggestions?: number;
/**
* The maximum amount of time in milliseconds to generate suggestions for a word.
* @default 500
*/
suggestionsTimeout?: number;
/**
* The maximum number of changes allowed on a word to be considered a suggestions.
*
* For example, appending an `s` onto `example` -> `examples` is considered 1 change.
*
* Range: between 1 and 5.
* @default 3
*/
suggestionNumChanges?: number;
}
/**
* Plug N Play settings to support package systems like Yarn 2.
*/
export interface PnPSettings {
/**
* Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading
* packages stored in the repository.
*
* When true, the spell checker will search up the directory structure for the existence
* of a PnP file and load it.
*
* @default false
*/
usePnP?: boolean;
/**
* The PnP files to search for. Note: `.mjs` files are not currently supported.
*
* @default [".pnp.js", ".pnp.cjs"]
*/
pnpFiles?: string[];
}
/**
* The Strategy to use to detect if a file has changed.
* - `metadata` - uses the file system timestamp and size to detect changes (fastest).
* - `content` - uses a hash of the file content to check file changes (slower - more accurate).
*/
export type CacheStrategy = 'metadata' | 'content';
export interface CacheSettings {
/**
* Store the results of processed files in order to only operate on the changed ones.
* @default false
*/
useCache?: boolean;
// cspell:word cspellcache
/**
* Path to the cache location. Can be a file or a directory.
* If none specified `.cspellcache` will be used.
* Relative paths are relative to the config file in which it
* is defined.
*
* A prefix of `${cwd}` is replaced with the current working directory.
*/
cacheLocation?: FSPathResolvable;
/**
* Strategy to use for detecting changed files, default: metadata
* @default 'metadata'
*/
cacheStrategy?: CacheStrategy;
}
/**
* These are settings only used by the command line application.
*/
export interface CommandLineSettings {
/**
* Define cache settings.
*/
cache?: CacheSettings;
/**
* Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks)
* @default false
*/
failFast?: boolean;
}
/**
* To prevent the unwanted execution of untrusted code, WorkspaceTrustSettings
* are use to set the trust levels.
*
* Trust setting have an impact on both `cspell.config.js` files and on `.pnp.js` files.
* In an untrusted location, these files will NOT be used.
*
* This will also prevent any associated plugins from being loaded.
*/
export interface WorkspaceTrustSettings {
/**
* Glob patterns of locations that contain ALWAYS trusted files.
*/
trustedFiles?: Glob[];
/**
* Glob patterns of locations that contain NEVER trusted files.
*/
untrustedFiles?: Glob[];
/**
* Sets the default trust level.
* @default "trusted"
*/
trustLevel?: TrustLevel;
}
/**
* VS Code Spell Checker Settings.
* To be Removed.
* @deprecated true
*/
export interface LegacySettings {
/**
* Show status.
* @deprecated true
*/
showStatus?: boolean;
/**
* Delay in ms after a document has changed before checking it for spelling errors.
* @deprecated true
*/
spellCheckDelayMs?: number;
/************************/
}
export interface OverrideSettings extends Settings, OverrideFilterFields {
/** Sets the programming language id. */
languageId?: LanguageId;
/** Sets the locale. */
language?: LocaleId;
}
export interface OverrideFilterFields {
/** Glob pattern or patterns to match against. */
filename: Glob | Glob[];
}
export interface BaseSetting {
/** Optional identifier. */
id?: string;
/** Optional name of configuration. */
name?: string;
/** Optional description of configuration. */
description?: string;
/**
* Is the spell checker enabled.
* @default true
*/
enabled?: boolean;
/** List of words to be always considered correct. */
words?: string[];
/** List of words to always be considered incorrect. */
flagWords?: string[];
/** List of words to be ignored. An Ignored word will not show up as an error even if it is also in the `flagWords`. */
ignoreWords?: string[];
/**
* True to enable compound word checking.
* @default false
*/
allowCompoundWords?: boolean;
/**
* Determines if words must match case and accent rules.
*
* - `false` - Case is ignored and accents can be missing on the entire word.
* Incorrect accents or partially missing accents will be marked as incorrect.
* - `true` - Case and accents are enforced.
*
* @default false
*/
caseSensitive?: boolean;
/** Define additional available dictionaries. */
dictionaryDefinitions?: DictionaryDefinition[];
/**
* Optional list of dictionaries to use.
* Each entry should match the name of the dictionary.
* To remove a dictionary from the list add `!` before the name.
* i.e. `!typescript` will turn off the dictionary with the name `typescript`.
*/
dictionaries?: DictionaryReference[];
/**
* Optional list of dictionaries that will not be used for suggestions.
* Words in these dictionaries are considered correct, but will not be
* used when making spell correction suggestions.
*
* Note: if a word is suggested by another dictionary, but found in
* one of these dictionaries, it will be removed from the set of
* possible suggestions.
*/
noSuggestDictionaries?: DictionaryReference[];
/**
* List of RegExp patterns or Pattern names to exclude from spell checking.
*
* Example: ["href"] - to exclude html href.
*/
ignoreRegExpList?: RegExpPatternList;
/**
* List of RegExp patterns or defined Pattern names to define the text to be included for spell checking.
* If includeRegExpList is defined, ONLY, text matching the included patterns will be checked.
*/
includeRegExpList?: RegExpPatternList;
/** Defines a list of patterns that can be used in ignoreRegExpList and includeRegExpList. */
patterns?: RegExpPatternDefinition[];
}
export type DictionaryFileTypes = 'S' | 'W' | 'C' | 'T';
export type DictionaryDefinition =
| DictionaryDefinitionPreferred
| DictionaryDefinitionCustom
| DictionaryDefinitionAugmented
| DictionaryDefinitionAlternate
| DictionaryDefinitionLegacy;
export interface DictionaryDefinitionBase {
/**
* This is the name of a dictionary.
*
* Name Format:
* - Must contain at least 1 number or letter.
* - Spaces are allowed.
* - Leading and trailing space will be removed.
* - Names ARE case-sensitive.
* - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
*/
name: DictionaryId;
/** Optional description. */
description?: string;
/** Replacement pairs. */
repMap?: ReplaceMap;
/** Use Compounds. */
useCompounds?: boolean;
/**
* Indicate that suggestions should not come from this dictionary.
* Words in this dictionary are considered correct, but will not be
* used when making spell correction suggestions.
*
* Note: if a word is suggested by another dictionary, but found in
* this dictionary, it will be removed from the set of
* possible suggestions.
*/
noSuggest?: boolean;
/**
* Type of file:
* S - single word per line,
* W - each line can contain one or more words separated by space,
* C - each line is treated like code (Camel Case is allowed).
* Default is S.
* C is the slowest to load due to the need to split each line based upon code splitting rules.
* @default "S"
*/
type?: DictionaryFileTypes;
}
export interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
/** Path to the file. */
path: DictionaryPath;
/**
* Only for legacy dictionary definitions.
* @deprecated true
* @deprecationMessage Use `path` instead.
* @hidden
*/
file?: undefined;
}
/**
* Used to provide extra data related to the dictionary
*/
export interface DictionaryDefinitionAugmented extends DictionaryDefinitionPreferred {
dictionaryInformation?: DictionaryInformation;
}
/**
* Only for legacy dictionary definitions.
* @deprecated true
* @deprecationMessage Use `DictionaryDefinitionPreferred` instead.
*/
export interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase {
/** @hidden */
path?: undefined;
/**
* Path to the file, only for legacy dictionary definitions.
* @deprecated true
* @deprecationMessage Use `path` instead.
*/
file: DictionaryPath;
/** @hidden */
suggestionEditCosts?: undefined;
}
/**
* @deprecated true
* @hidden
*/
export interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
/** Path to the file, if undefined the path to the extension dictionaries is assumed. */
path?: FsPath;
/**
* File name.
* @deprecated true
* @deprecationMessage Use `path` instead.
*/
file: FsPath;
/**
* Type of file:
* S - single word per line,
* W - each line can contain one or more words separated by space,
* C - each line is treated like code (Camel Case is allowed).
* Default is S.
* C is the slowest to load due to the need to split each line based upon code splitting rules.
* @default "S"
*/
type?: DictionaryFileTypes;
/**
* @hidden
*/
suggestionEditCosts?: undefined;
}
/**
* Specifies the scope of a dictionary.
*/
export type CustomDictionaryScope = 'user' | 'workspace' | 'folder';
/**
* For Defining Custom dictionaries. They are generally scoped to a
* `user`, `workspace`, or `folder`.
* When `addWords` is true, indicates that the spell checker can add words
* to the file.
* Note: only plain text files with one word per line are supported at this moment.
*/
export interface DictionaryDefinitionCustom extends DictionaryDefinitionPreferred {
/** Path to custom dictionary text file. */
path: CustomDictionaryPath;
/**
* Defines the scope for when words will be added to the dictionary.
* Scope values: `user`, `workspace`, `folder`.
*/
scope?: CustomDictionaryScope | CustomDictionaryScope[];
/**
* When `true`, let's the spell checker know that words can be added to this dictionary.
*/
addWords: boolean;
}
export interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {}
export interface LanguageSettingFilterFields
extends LanguageSettingFilterFieldsPreferred,
LanguageSettingFilterFieldsDeprecated {}
export interface LanguageSettingFilterFieldsPreferred {
/** The language id. Ex: "typescript", "html", or "php". "*" -- will match all languages. */
languageId: LanguageId | LanguageIdSingle[];
/** The locale filter, matches against the language. This can be a comma separated list. "*" will match all locales. */
locale?: LocaleId | LocaleId[];
}
export interface LanguageSettingFilterFieldsDeprecated {
/** The language id. Ex: "typescript", "html", or "php". "*" -- will match all languages. */
languageId: LanguageId | LanguageIdSingle[];
/**
* Deprecated - The locale filter, matches against the language. This can be a comma separated list. "*" will match all locales.
* @deprecated true
* @deprecationMessage Use `locale` instead.
*/
local?: LocaleId | LocaleId[];
}
/** @hidden */
type InternalRegExp = RegExp;
export type Pattern = string | InternalRegExp;
export 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';
/** This matches the name in a pattern definition. */
export type PatternId = string;
/** A PatternRef is a Pattern or PatternId. */
export type PatternRef = Pattern | PatternId | PredefinedPatterns;
/** A list of pattern names or regular expressions. */
export type RegExpPatternList = PatternRef[];
/**
* This is the name of a dictionary.
*
* Name Format:
* - Must contain at least 1 number or letter.
* - Spaces are allowed.
* - Leading and trailing space will be removed.
* - Names ARE case-sensitive.
* - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
*
* @pattern ^(?=[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
*/
export type DictionaryId = string;
/**
* This a reference to a named dictionary.
* It is expected to match the name of a dictionary.
*/
export type DictionaryRef = DictionaryId;
/**
* This a negative reference to a named dictionary.
*
* It is used to exclude or include a dictionary by name.
*
* The reference starts with 1 or more `!`.
* - `!<dictionary_name>` - Used to exclude the dictionary matching `<dictionary_name>`.
* - `!!<dictionary_name>` - Used to re-include a dictionary matching `<dictionary_name>`.
* Overrides `!<dictionary_name>`.
* - `!!!<dictionary_name>` - Used to exclude a dictionary matching `<dictionary_name>`.
* Overrides `!!<dictionary_name>`.
*
* @pattern ^(?=!+[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
*/
export type DictionaryNegRef = string;
/**
* Reference to a dictionary by name.
* One of:
* - {@link DictionaryRef}
* - {@link DictionaryNegRef}
*/
export type DictionaryReference = DictionaryRef | DictionaryNegRef;
/** This is a written language locale like: 'en', 'en-GB', 'fr', 'es', 'de', etc. */
export type LocaleId = string;
/**
* Configuration File Version.
*/
export type VersionLatest = '0.2';
/**
* Legacy Configuration File Versions.
* @deprecated true
* @deprecationMessage Use `0.2` instead.
*/
export type VersionLegacy = '0.1';
export type Version = VersionLatest | VersionLegacy;
/**
* @deprecated true
* @deprecationMessage Use `LocaleId` instead.
*/
export type LocalId = LocaleId;
/** These are glob expressions. */
export type Glob = SimpleGlob | GlobDef;
/** Simple Glob string, the root will be globRoot. */
export type SimpleGlob = string;
/**
* Used to define fully qualified glob patterns.
* It is currently hidden to make the json-schema a bit easier to use
* when crafting cspell.json files by hand.
* @hidden
*/
export interface GlobDef {
/** Glob pattern to match. */
glob: string;
/** Optional root to use when matching the glob. Defaults to current working dir. */
root?: string;
/**
* Optional source of the glob, used when merging settings to determine the origin.
* @hidden
*/
source?: string;
}
/**
* This can be '*', 'typescript', 'cpp', 'json', etc.
* @pattern ^(!?[-\w_\s]+)|(\*)$
*/
export type LanguageIdSingle = string;
/**
* This can be 'typescript,cpp,json,literal haskell', etc.
* @pattern ^([-\w_\s]+)(,[-\w_\s]+)*$
*/
export type LanguageIdMultiple = string;
/**
* This can be 'typescript,cpp,json,literal haskell', etc.
* @pattern ^(![-\w_\s]+)(,![-\w_\s]+)*$
*/
export type LanguageIdMultipleNeg = string;
export type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
/**
* A File System Path. Relative paths are relative to the configuration file.
*/
export type FsPath = string;
/**
* A File System Path.
*
* Special Properties:
* - `${cwd}` prefix - will be replaced with the current working directory.
* - Relative paths are relative to the configuration file.
*/
export type FSPathResolvable = FsPath;
/** Trust Security Level. */
export type TrustLevel = 'trusted' | 'untrusted';
/**
* A File System Path to a dictionary file.
* @pattern ^.*\.(?:txt|trie)(?:\.gz)?$
*/
export type DictionaryPath = string;
/**
* A File System Path to a dictionary file.
* @pattern ^.*\.txt$
*/
export type CustomDictionaryPath = string;
export interface RegExpPatternDefinition {
/**
* Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList.
* It is possible to redefine one of the predefined patterns to override its value.
*/
name: PatternId;
/**
* RegExp pattern or array of RegExp patterns.
*/
pattern: Pattern | Pattern[];
/**
* Description of the pattern.
*/
description?: string | undefined;
}
export type CSpellUserSettingsWithComments = CSpellUserSettings;
// Remove BaseSource from the Source list when the code is ready.
export type Source = FileSource | MergeSource | InMemorySource | BaseSource;
export interface FileSource extends BaseSource {
/** Name of source. */
name: string;
/** Filename if this came from a file. */
filename: string;
/** The two settings that were merged to. */
sources?: undefined;
/** The configuration read. */
fileSource: CSpellSettings;
}
export interface MergeSource extends BaseSource {
/** Name of source. */
name: string;
/** Filename if this came from a file. */
filename?: undefined;
/** The two settings that were merged to. */
sources: [CSpellSettings] | [CSpellSettings, CSpellSettings];
/** The configuration read. */
fileSource?: undefined;
}
export interface InMemorySource extends BaseSource {
/** Name of source. */
name: string;
/** Filename if this came from a file. */
filename?: undefined;
/** The two settings that were merged to. */
sources?: undefined;
/** The configuration read. */
fileSource?: undefined;
}
interface BaseSource {
/** Name of source. */
name: string;
/** Filename if this came from a file. */
filename?: string | undefined;
/** The two settings that were merged to. */
sources?: [CSpellSettings] | [CSpellSettings, CSpellSettings] | undefined;
/** The configuration read. */
fileSource?: CSpellSettings | undefined;
}
/**
* Reporter name or reporter name + reporter config.
*/
export type ReporterSettings = string | [string] | [string, unknown];