Fix activation when `files.excludes` contains braces (#789)

* Fix activation when `files.excludes` contains braces

* Fix file exclude when searching for CSS files
master
Brad Cornes 2023-05-25 13:24:38 +01:00 committed by GitHub
parent 4d0623ede0
commit 53b81ca460
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -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)) {