Skip to content

Commit 32c9336

Browse files
fix(vscode): handle typescript-language-features module loading race condition (#5260)
1 parent 61fc3ca commit 32c9336

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

extensions/vscode/src/nodeClientMain.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,15 @@ try {
199199
// @ts-expect-error
200200
return readFileSync(...args);
201201
};
202+
203+
const loadedModule = require.cache[extensionJsPath];
204+
if (loadedModule) {
205+
delete require.cache[extensionJsPath];
206+
const patchedModule = require(extensionJsPath);
207+
Object.assign(loadedModule.exports, patchedModule);
208+
}
209+
210+
if (tsExtension.isActive) {
211+
vscode.commands.executeCommand('workbench.action.restartExtensionHost');
212+
}
202213
} catch { }

0 commit comments

Comments
 (0)