@@ -18,6 +18,7 @@ import {
18
18
TextEditorDecorationType ,
19
19
RelativePattern ,
20
20
ConfigurationScope ,
21
+ WorkspaceConfiguration ,
21
22
} from 'vscode'
22
23
import {
23
24
LanguageClient ,
@@ -83,15 +84,16 @@ function getUserLanguages(folder?: WorkspaceFolder): Record<string, string> {
83
84
return isObject ( langs ) ? langs : { }
84
85
}
85
86
86
- function getExcludePatterns ( folder : WorkspaceFolder ) : string [ ] {
87
- let globalExclude = Workspace . getConfiguration ( 'files' , folder ) . get ( 'exclude' )
88
- let exclude = Object . entries ( globalExclude )
89
- . filter ( ( [ , value ] ) => value )
87
+ function getGlobalExcludePatterns ( scope : ConfigurationScope ) : string [ ] {
88
+ return Object . entries ( Workspace . getConfiguration ( 'files' , scope ) . get ( 'exclude' ) )
89
+ . filter ( ( [ , value ] ) => value === true )
90
90
. map ( ( [ key ] ) => key )
91
+ }
91
92
93
+ function getExcludePatterns ( scope : ConfigurationScope ) : string [ ] {
92
94
return [
93
- ...exclude ,
94
- ...( < string [ ] > Workspace . getConfiguration ( 'tailwindCSS' , folder ) . get ( 'files.exclude' ) ) ,
95
+ ...getGlobalExcludePatterns ( scope ) ,
96
+ ...( < string [ ] > Workspace . getConfiguration ( 'tailwindCSS' , scope ) . get ( 'files.exclude' ) ) ,
95
97
]
96
98
}
97
99
@@ -107,17 +109,12 @@ function isExcluded(file: string, folder: WorkspaceFolder): boolean {
107
109
return false
108
110
}
109
111
110
- function mergeExcludes ( settings , scope ) {
111
- // merge `files.exclude` into `tailwindCSS.files.exclude`
112
- let globalExclude = Object . entries ( Workspace . getConfiguration ( 'files' , scope ) . get ( 'exclude' ) )
113
- . filter ( ( [ , value ] ) => value )
114
- . map ( ( [ key ] ) => key )
115
-
112
+ function mergeExcludes ( settings : WorkspaceConfiguration , scope : ConfigurationScope ) {
116
113
return {
117
114
...settings ,
118
115
files : {
119
116
...settings . files ,
120
- exclude : [ ...globalExclude , ...settings . files . exclude ] ,
117
+ exclude : [ ...getGlobalExcludePatterns ( scope ) , ...settings . files . exclude ] ,
121
118
} ,
122
119
}
123
120
}
0 commit comments