From ed95234b229e17f0615281f935b5011ba4a2de45 Mon Sep 17 00:00:00 2001 From: chemzqm Date: Fri, 25 Jan 2019 20:28:12 +0800 Subject: [PATCH] use workspace root as project root when possible --- src/server/typescriptServiceClient.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/typescriptServiceClient.ts b/src/server/typescriptServiceClient.ts index e9a8e1c..10b9690 100644 --- a/src/server/typescriptServiceClient.ts +++ b/src/server/typescriptServiceClient.ts @@ -815,6 +815,7 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient public getProjectRootPath(uri: string): string { let u = Uri.parse(uri) if (u.scheme != 'file') return workspace.root + if (u.fsPath.startsWith(workspace.root)) return workspace.root let res = findUp.sync(['package.json', 'tsconfig.json', 'jsconfig.json'], { cwd: path.dirname(u.fsPath) }) return res ? path.dirname(res) : workspace.rootPath }