Skip to content

Commit

Permalink
fix(vscode): handle typescript-language-features module loading rac…
Browse files Browse the repository at this point in the history
…e condition (#5260)
  • Loading branch information
johnsoncodehk authored Mar 7, 2025
1 parent 61fc3ca commit 32c9336
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions extensions/vscode/src/nodeClientMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,15 @@ try {
// @ts-expect-error
return readFileSync(...args);
};

const loadedModule = require.cache[extensionJsPath];
if (loadedModule) {
delete require.cache[extensionJsPath];
const patchedModule = require(extensionJsPath);
Object.assign(loadedModule.exports, patchedModule);
}

if (tsExtension.isActive) {
vscode.commands.executeCommand('workbench.action.restartExtensionHost');
}
} catch { }

0 comments on commit 32c9336

Please sign in to comment.