Fix activation when `files.excludes` contains braces (#789)
* Fix activation when `files.excludes` contains braces * Fix file exclude when searching for CSS filesmaster
parent
4d0623ede0
commit
53b81ca460
|
@ -644,11 +644,15 @@ export async function activate(context: ExtensionContext) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let exclude = `{${getExcludePatterns(folder)
|
||||||
|
.flatMap((pattern) => braces.expand(pattern))
|
||||||
|
.join(',')
|
||||||
|
.replace(/{/g, '%7B')
|
||||||
|
.replace(/}/g, '%7D')}}`
|
||||||
|
|
||||||
let [configFile] = await Workspace.findFiles(
|
let [configFile] = await Workspace.findFiles(
|
||||||
new RelativePattern(folder, `**/${CONFIG_GLOB}`),
|
new RelativePattern(folder, `**/${CONFIG_GLOB}`),
|
||||||
`{${getExcludePatterns(folder)
|
exclude,
|
||||||
.flatMap((pattern) => braces.expand(pattern))
|
|
||||||
.join(',')}}`,
|
|
||||||
1
|
1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -657,10 +661,7 @@ export async function activate(context: ExtensionContext) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let cssFiles = await Workspace.findFiles(
|
let cssFiles = await Workspace.findFiles(new RelativePattern(folder, `**/${CSS_GLOB}`), exclude)
|
||||||
new RelativePattern(folder, `**/${CSS_GLOB}`),
|
|
||||||
`{${getExcludePatterns(folder).join(',')}}`
|
|
||||||
)
|
|
||||||
|
|
||||||
for (let cssFile of cssFiles) {
|
for (let cssFile of cssFiles) {
|
||||||
if (await fileContainsAtConfig(cssFile)) {
|
if (await fileContainsAtConfig(cssFile)) {
|
||||||
|
|
Loading…
Reference in New Issue