Skip to content

Commit 7fe0f9d

Browse files
authored
Merge pull request microsoft#26793 from minestarks/parentDirFix
Fix incorrect path computation of typesMap.json
2 parents d8f736d + 2fe3499 commit 7fe0f9d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/server/editorServices.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ namespace ts.server {
487487
this.globalPlugins = opts.globalPlugins || emptyArray;
488488
this.pluginProbeLocations = opts.pluginProbeLocations || emptyArray;
489489
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
490-
this.typesMapLocation = (opts.typesMapLocation === undefined) ? combinePaths(this.getExecutingFilePath(), "../typesMap.json") : opts.typesMapLocation;
490+
this.typesMapLocation = (opts.typesMapLocation === undefined) ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation;
491491
this.syntaxOnly = opts.syntaxOnly;
492492

493493
Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService");

src/tsserver/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ namespace ts.server {
924924
setStackTraceLimit();
925925

926926
const typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation)!; // TODO: GH#18217
927-
const typesMapLocation = findArgument(Arguments.TypesMapLocation) || combinePaths(sys.getExecutingFilePath(), "../typesMap.json");
927+
const typesMapLocation = findArgument(Arguments.TypesMapLocation) || combinePaths(getDirectoryPath(sys.getExecutingFilePath()), "typesMap.json");
928928
const npmLocation = findArgument(Arguments.NpmLocation);
929929

930930
function parseStringArray(argName: string): ReadonlyArray<string> {

0 commit comments

Comments
 (0)