Skip to content

Commit f5bcefc

Browse files
Ensure file exclusions always work on Windows (#1281)
Sometimes exclusions weren't processed correctly on Windows. This cause additional results to show up in file path completions in things like `@config`, `@plugim`, `@source`, etc…
1 parent 765ebce commit f5bcefc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/tailwindcss-language-server/src/util/isExcluded.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as path from 'node:path'
33
import type { TextDocument } from 'vscode-languageserver-textdocument'
44
import type { State } from '@tailwindcss/language-service/src/util/state'
55
import { getFileFsPath } from './uri'
6+
import { normalizePath, normalizeDriveLetter } from '../utils'
67

78
export default async function isExcluded(
89
state: State,
@@ -11,8 +12,15 @@ export default async function isExcluded(
1112
): Promise<boolean> {
1213
let settings = await state.editor.getConfiguration(document.uri)
1314

15+
file = normalizePath(file)
16+
file = normalizeDriveLetter(file)
17+
1418
for (let pattern of settings.tailwindCSS.files.exclude) {
15-
if (picomatch(path.join(state.editor.folder, pattern))(file)) {
19+
pattern = path.join(state.editor.folder, pattern)
20+
pattern = normalizePath(pattern)
21+
pattern = normalizeDriveLetter(pattern)
22+
23+
if (picomatch(pattern)(file)) {
1624
return true
1725
}
1826
}

packages/vscode-tailwindcss/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Prerelease
44

55
- Fix content detection when using v4.0+ ([#1280](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1280))
6+
- Ensure file exclusions always work on Windows ([#1281](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1281))
67

78
# 0.14.11
89

0 commit comments

Comments
 (0)