Skip to content

Commit 53b81ca

Browse files
authored
Fix activation when files.excludes contains braces (#789)
* Fix activation when `files.excludes` contains braces * Fix file exclude when searching for CSS files
1 parent 4d0623e commit 53b81ca

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/vscode-tailwindcss/src/extension.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,15 @@ export async function activate(context: ExtensionContext) {
644644
return
645645
}
646646

647+
let exclude = `{${getExcludePatterns(folder)
648+
.flatMap((pattern) => braces.expand(pattern))
649+
.join(',')
650+
.replace(/{/g, '%7B')
651+
.replace(/}/g, '%7D')}}`
652+
647653
let [configFile] = await Workspace.findFiles(
648654
new RelativePattern(folder, `**/${CONFIG_GLOB}`),
649-
`{${getExcludePatterns(folder)
650-
.flatMap((pattern) => braces.expand(pattern))
651-
.join(',')}}`,
655+
exclude,
652656
1
653657
)
654658

@@ -657,10 +661,7 @@ export async function activate(context: ExtensionContext) {
657661
return
658662
}
659663

660-
let cssFiles = await Workspace.findFiles(
661-
new RelativePattern(folder, `**/${CSS_GLOB}`),
662-
`{${getExcludePatterns(folder).join(',')}}`
663-
)
664+
let cssFiles = await Workspace.findFiles(new RelativePattern(folder, `**/${CSS_GLOB}`), exclude)
664665

665666
for (let cssFile of cssFiles) {
666667
if (await fileContainsAtConfig(cssFile)) {

0 commit comments

Comments
 (0)