Skip to content

Commit 3ec0603

Browse files
committed
Retain the casing in map files in file names
1 parent ab4be8d commit 3ec0603

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compiler/sourcemapDecoder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace ts.sourcemaps {
8383
if (!maps[targetIndex] || comparePaths(loc.fileName, maps[targetIndex].sourcePath, sourceRoot, !host.useCaseSensitiveFileNames) !== 0) {
8484
return loc;
8585
}
86-
return { fileName: toPath(map.file!, sourceRoot, host.getCanonicalFileName), position: maps[targetIndex].emittedPosition }; // Closest pos
86+
return { fileName: getNormalizedAbsolutePath(map.file!, sourceRoot), position: maps[targetIndex].emittedPosition }; // Closest pos
8787
}
8888

8989
function getOriginalPosition(loc: SourceMappableLocation): SourceMappableLocation {
@@ -94,7 +94,7 @@ namespace ts.sourcemaps {
9494
// if no exact match, closest is 2's compliment of result
9595
targetIndex = ~targetIndex;
9696
}
97-
return { fileName: toPath(maps[targetIndex].sourcePath, sourceRoot, host.getCanonicalFileName), position: maps[targetIndex].sourcePosition }; // Closest pos
97+
return { fileName: getNormalizedAbsolutePath(maps[targetIndex].sourcePath, sourceRoot), position: maps[targetIndex].sourcePosition }; // Closest pos
9898
}
9999

100100
function getSourceFileLike(fileName: string, location: string): SourceFileLike | undefined {

src/testRunner/unittests/tsserverProjectSystem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10655,7 +10655,7 @@ declare class TestLib {
1065510655
const dependecyLocation = `${projectLocation}/dependency`;
1065610656
const mainLocation = `${projectLocation}/main`;
1065710657
const dependencyTs: File = {
10658-
path: `${dependecyLocation}/fns.ts`,
10658+
path: `${dependecyLocation}/FnS.ts`,
1065910659
content: `export function fn1() { }
1066010660
export function fn2() { }
1066110661
export function fn3() { }

0 commit comments

Comments
 (0)