Merge pull request #11 from jpoppe/patch-2
bug fix: workspace.cwd -> workspace.root in getProjectRootPath()
This commit is contained in:
commit
9e7f12842a
1 changed files with 1 additions and 1 deletions
|
@ -815,7 +815,7 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
|
||||||
public getProjectRootPath(uri: string): string {
|
public getProjectRootPath(uri: string): string {
|
||||||
let u = Uri.parse(uri)
|
let u = Uri.parse(uri)
|
||||||
if (u.scheme != 'file') return workspace.cwd
|
if (u.scheme != 'file') return workspace.cwd
|
||||||
if (u.fsPath.startsWith(workspace.root) && workspace.root != os.homedir()) return workspace.cwd
|
if (u.fsPath.startsWith(workspace.root) && workspace.root != os.homedir()) return workspace.root
|
||||||
let res = findUp.sync(['tsconfig.json', 'jsconfig.json'], { cwd: path.dirname(u.fsPath) })
|
let res = findUp.sync(['tsconfig.json', 'jsconfig.json'], { cwd: path.dirname(u.fsPath) })
|
||||||
return res ? path.dirname(res) : workspace.cwd
|
return res ? path.dirname(res) : workspace.cwd
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue