From 2fe349915319278ca7fbcc7a22da8b0aa175d572 Mon Sep 17 00:00:00 2001 From: Mine Starks Date: Thu, 30 Aug 2018 14:02:26 -0700 Subject: [PATCH] Fix faulty path handling --- src/server/editorServices.ts | 2 +- src/tsserver/server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 117887d7611..ca8c61311ec 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -472,7 +472,7 @@ namespace ts.server { this.globalPlugins = opts.globalPlugins || emptyArray; this.pluginProbeLocations = opts.pluginProbeLocations || emptyArray; this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads; - this.typesMapLocation = (opts.typesMapLocation === undefined) ? combinePaths(this.getExecutingFilePath(), "../typesMap.json") : opts.typesMapLocation; + this.typesMapLocation = (opts.typesMapLocation === undefined) ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation; this.syntaxOnly = opts.syntaxOnly; Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); diff --git a/src/tsserver/server.ts b/src/tsserver/server.ts index 3e5986e9408..d7ced146707 100644 --- a/src/tsserver/server.ts +++ b/src/tsserver/server.ts @@ -920,7 +920,7 @@ namespace ts.server { setStackTraceLimit(); const typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation)!; // TODO: GH#18217 - const typesMapLocation = findArgument(Arguments.TypesMapLocation) || combinePaths(sys.getExecutingFilePath(), "../typesMap.json"); + const typesMapLocation = findArgument(Arguments.TypesMapLocation) || combinePaths(getDirectoryPath(sys.getExecutingFilePath()), "typesMap.json"); const npmLocation = findArgument(Arguments.NpmLocation); function parseStringArray(argName: string): ReadonlyArray {