Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix activation when files.excludes contains braces #789

Merged
merged 2 commits into from
May 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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