Skip to content

Commit

Permalink
fix: don't change dir for not exists workspace
Browse files Browse the repository at this point in the history
close #2039, close #2234
  • Loading branch information
johnsoncodehk committed Dec 25, 2022
1 parent 572b785 commit 63b794a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/language-server/src/node/fileSystem.ts
Expand Up @@ -63,7 +63,9 @@ export function createNodeFileSystemHost(
return new Proxy(fn, {
apply(target, thisArg, args) {
if (currentCwd !== rootPath) {
process.chdir(rootPath);
if (ts.sys.directoryExists(rootPath)) { // #2234, #2039
process.chdir(rootPath);
}
currentCwd = rootPath;
}
return (target as any).apply(thisArg, args);
Expand Down

0 comments on commit 63b794a

Please sign in to comment.