Skip to content

Commit

Permalink
Fix error when a files.excludes pattern contains braces (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradlc committed Jan 13, 2023
1 parent fd9de48 commit 16b1148
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/vscode-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@
"check": "tsc --noEmit"
},
"devDependencies": {
"@types/braces": "3.0.1",
"@types/vscode": "1.65.0",
"braces": "3.0.2",
"color-name": "1.1.4",
"concurrently": "7.0.0",
"rimraf": "3.0.2",
Expand Down
5 changes: 4 additions & 1 deletion packages/vscode-tailwindcss/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { dedupe, equal } from 'tailwindcss-language-service/src/util/array'
import namedColors from 'color-name'
import minimatch from 'minimatch'
import { CONFIG_GLOB, CSS_GLOB } from 'tailwindcss-language-server/src/lib/constants'
import braces from 'braces'

const colorNames = Object.keys(namedColors)

Expand Down Expand Up @@ -644,7 +645,9 @@ export async function activate(context: ExtensionContext) {

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

Expand Down

0 comments on commit 16b1148

Please sign in to comment.