From 23ac1e260d459a6f0adae3533f8b766eb3afad88 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Tue, 21 Jan 2025 14:07:53 -0500 Subject: [PATCH 1/2] Fix resolving tsconfig paths on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes drive letters have different casing. In this case project discovery works fine but when base paths are passed from VSCode resolving doesn’t work. --- .../tailwindcss-language-server/src/resolver/tsconfig.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/tailwindcss-language-server/src/resolver/tsconfig.ts b/packages/tailwindcss-language-server/src/resolver/tsconfig.ts index e578613f..3321fd1e 100644 --- a/packages/tailwindcss-language-server/src/resolver/tsconfig.ts +++ b/packages/tailwindcss-language-server/src/resolver/tsconfig.ts @@ -8,7 +8,7 @@ import * as path from 'node:path' import * as tsconfig from 'tsconfig-paths' import * as tsconfck from 'tsconfck' -import { normalizePath } from '../utils' +import { normalizeDriveLetter, normalizePath } from '../utils' import { DefaultMap } from '../util/default-map' export interface TSConfigApi { @@ -205,7 +205,7 @@ async function createMatchers( let assumeExists: tsconfig.FileExistsAsync = (_, callback) => callback(undefined, true) for (let result of configs) { - let parent = normalizePath(path.dirname(result.tsconfigFile)) + let parent = normalizeDriveLetter(normalizePath(path.dirname(result.tsconfigFile))) let opts = result.tsconfig.compilerOptions ?? {} @@ -257,7 +257,7 @@ async function createMatchers( } function* walkPaths(base: string) { - let projectDir = normalizePath(base) + let projectDir = normalizeDriveLetter(normalizePath(base)) let prevProjectDir: string | undefined while (projectDir !== prevProjectDir) { From 413220fafdc3a58c242cc46b19be4be35ef3191b Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Tue, 21 Jan 2025 14:12:45 -0500 Subject: [PATCH 2/2] Update changelog --- packages/vscode-tailwindcss/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vscode-tailwindcss/CHANGELOG.md b/packages/vscode-tailwindcss/CHANGELOG.md index 1e74bd14..dd1467d8 100644 --- a/packages/vscode-tailwindcss/CHANGELOG.md +++ b/packages/vscode-tailwindcss/CHANGELOG.md @@ -2,7 +2,7 @@ ## Prerelease -- Nothing yet! +- Fix detection of TypeScript config paths on Windows ([#1130](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1130)) ## 0.14.0