@@ -11,31 +11,19 @@ import ignore from "ignore";
11
11
* @typedef {{
12
12
* defaultDialect?: string;
13
13
* schemaFilePatterns: string[];
14
- * detectIndentation: boolean;
15
- * }} DocumentSettings
16
- */
17
-
18
- /**
19
- * @typedef {{
20
- * jsonSchemaLanguageServer?: DocumentSettings;
21
- * }} Settings
22
- */
23
-
24
- /**
25
- * @typedef {{
14
+ * detectIndentation?: boolean;
26
15
* tabSize?: number;
27
16
* insertSpaces?: boolean;
28
- * detectIndentation?: boolean;
29
- * endOfLine?: string;
30
- * }} IndentationSettings
17
+ * endOfLine: string;
18
+ * }} DocumentSettings
31
19
*/
32
20
21
+
33
22
export class Configuration {
34
23
#server;
35
24
36
25
/** @type DocumentSettings | undefined */
37
26
#settings;
38
-
39
27
/** @type Partial<DocumentSettings> */
40
28
#defaultSettings;
41
29
@@ -52,7 +40,8 @@ export class Configuration {
52
40
this . #server = server ;
53
41
54
42
this . #defaultSettings = {
55
- schemaFilePatterns : [ "*.schema.json" , "schema.json" ]
43
+ schemaFilePatterns : [ "*.schema.json" , "schema.json" ] ,
44
+ detectIndentation : true
56
45
} ;
57
46
58
47
let hasDidChangeConfigurationCapability = false ;
@@ -93,13 +82,13 @@ export class Configuration {
93
82
{ section : "editor" } ,
94
83
{ section : "files.eol" }
95
84
] ) ;
96
- const [ extensionSettings , editorSettings , eol ] = /** @type [DocumentSettings, IndentationSettings, string] */ ( config ) ;
97
- /** @type IndentationSettings */
85
+ const [ extensionSettings , editorSettings , eol ] = /** @type [Partial<DocumentSettings> | null, Partial<DocumentSettings> | null, string | null] */ ( config ) ;
98
86
const indentationSettings = {
99
87
tabSize : editorSettings ?. tabSize ,
100
88
insertSpaces : editorSettings ?. insertSpaces ,
101
89
detectIndentation : editorSettings ?. detectIndentation ?? this . #defaultSettings. detectIndentation ,
102
90
endOfLine : eol
91
+
103
92
} ;
104
93
105
94
const fullSettings = {
0 commit comments