Skip to content

Commit

Permalink
normalize path when testing existence
Browse files Browse the repository at this point in the history
Fix windows coverage miss
  • Loading branch information
isaacs committed Nov 15, 2023
1 parent aaa8924 commit 0929b17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/service/language-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
fileExists,
getCurrentDirectory,
getDirectories,
normalizePath,
readFile,
realpath,
} from '../ts-sys-cached.js'
Expand Down Expand Up @@ -58,7 +59,7 @@ export const getLanguageService = (): LanguageServiceWithHost => {
getCurrentDirectory,
getDirectories,
fileExists: path => {
if (fileVersions.has(path)) return true
if (fileVersions.has(normalizePath(path))) return true
return fileExists(path)
},
writeFile: ts.sys.writeFile,
Expand Down

0 comments on commit 0929b17

Please sign in to comment.