Skip to content

Commit

Permalink
Fix activation when files.excludes contains braces (#789)
Browse files Browse the repository at this point in the history
* Fix activation when `files.excludes` contains braces

* Fix file exclude when searching for CSS files
  • Loading branch information
bradlc authored May 25, 2023
1 parent 4d0623e commit 53b81ca
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/vscode-tailwindcss/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,15 @@ export async function activate(context: ExtensionContext) {
return
}

let exclude = `{${getExcludePatterns(folder)
.flatMap((pattern) => braces.expand(pattern))
.join(',')
.replace(/{/g, '%7B')
.replace(/}/g, '%7D')}}`

let [configFile] = await Workspace.findFiles(
new RelativePattern(folder, `**/${CONFIG_GLOB}`),
`{${getExcludePatterns(folder)
.flatMap((pattern) => braces.expand(pattern))
.join(',')}}`,
exclude,
1
)

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

let cssFiles = await Workspace.findFiles(
new RelativePattern(folder, `**/${CSS_GLOB}`),
`{${getExcludePatterns(folder).join(',')}}`
)
let cssFiles = await Workspace.findFiles(new RelativePattern(folder, `**/${CSS_GLOB}`), exclude)

for (let cssFile of cssFiles) {
if (await fileContainsAtConfig(cssFile)) {
Expand Down

0 comments on commit 53b81ca

Please sign in to comment.