From ce776b298644c693e41c46fac47873b3daee52ca Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Sat, 22 Mar 2025 12:47:37 -0400 Subject: [PATCH 1/2] Make sure file exclusions work correctly on Windows --- .../tailwindcss-language-server/src/util/isExcluded.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/tailwindcss-language-server/src/util/isExcluded.ts b/packages/tailwindcss-language-server/src/util/isExcluded.ts index beb4115a..df998e7f 100644 --- a/packages/tailwindcss-language-server/src/util/isExcluded.ts +++ b/packages/tailwindcss-language-server/src/util/isExcluded.ts @@ -3,6 +3,7 @@ import * as path from 'node:path' import type { TextDocument } from 'vscode-languageserver-textdocument' import type { State } from '@tailwindcss/language-service/src/util/state' import { getFileFsPath } from './uri' +import { normalizePath, normalizeDriveLetter } from '../utils' export default async function isExcluded( state: State, @@ -11,8 +12,15 @@ export default async function isExcluded( ): Promise { let settings = await state.editor.getConfiguration(document.uri) + file = normalizePath(file) + file = normalizeDriveLetter(file) + for (let pattern of settings.tailwindCSS.files.exclude) { - if (picomatch(path.join(state.editor.folder, pattern))(file)) { + pattern = path.join(state.editor.folder, pattern) + pattern = normalizePath(pattern) + pattern = normalizeDriveLetter(pattern) + + if (picomatch(pattern)(file)) { return true } } From 08a17dc41d078b7dad220584792615c45ccd233a Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Sat, 22 Mar 2025 14:11:46 -0400 Subject: [PATCH 2/2] Update changelog --- packages/vscode-tailwindcss/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vscode-tailwindcss/CHANGELOG.md b/packages/vscode-tailwindcss/CHANGELOG.md index 0ec6c3a4..de81de55 100644 --- a/packages/vscode-tailwindcss/CHANGELOG.md +++ b/packages/vscode-tailwindcss/CHANGELOG.md @@ -3,6 +3,7 @@ ## Prerelease - Fix content detection when using v4.0+ ([#1280](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1280)) +- Ensure file exclusions always work on Windows ([#1281](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1281)) # 0.14.11