Skip to content

Commit 9d714a6

Browse files
Fix resolving tsconfig paths on Windows (#1130)
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. I thought I'd tested this but apparently not.
1 parent b31d4a7 commit 9d714a6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/tailwindcss-language-server/src/resolver/tsconfig.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import * as path from 'node:path'
99
import * as tsconfig from 'tsconfig-paths'
1010
import * as tsconfck from 'tsconfck'
11-
import { normalizePath } from '../utils'
11+
import { normalizeDriveLetter, normalizePath } from '../utils'
1212
import { DefaultMap } from '../util/default-map'
1313

1414
export interface TSConfigApi {
@@ -205,7 +205,7 @@ async function createMatchers(
205205
let assumeExists: tsconfig.FileExistsAsync = (_, callback) => callback(undefined, true)
206206

207207
for (let result of configs) {
208-
let parent = normalizePath(path.dirname(result.tsconfigFile))
208+
let parent = normalizeDriveLetter(normalizePath(path.dirname(result.tsconfigFile)))
209209

210210
let opts = result.tsconfig.compilerOptions ?? {}
211211

@@ -257,7 +257,7 @@ async function createMatchers(
257257
}
258258

259259
function* walkPaths(base: string) {
260-
let projectDir = normalizePath(base)
260+
let projectDir = normalizeDriveLetter(normalizePath(base))
261261

262262
let prevProjectDir: string | undefined
263263
while (projectDir !== prevProjectDir) {

packages/vscode-tailwindcss/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Prerelease
44

5-
- Nothing yet!
5+
- Fix detection of TypeScript config paths on Windows ([#1130](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1130))
66

77
## 0.14.0
88

0 commit comments

Comments
 (0)