Skip to content

Commit 7c29865

Browse files
committed
Fix import of server-main.js from main
Neglected to update this import when fixing the other.
1 parent fc6064d commit 7c29865

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/node/main.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ export interface OpenCommandPipeArgs {
4949
export const runCodeCli = async (args: DefaultedArgs): Promise<void> => {
5050
logger.debug("Running Code CLI")
5151
try {
52-
const mod = require(path.join(vsRootPath, "out/server-main")) as VSCodeModule
52+
// See vscode.loadVSCode for more on this jank.
53+
const modPath = path.join(vsRootPath, "out/server-main.js")
54+
const mod = (await eval(`import("${modPath}")`)) as VSCodeModule
5355
const serverModule = await mod.loadCodeWithNls()
5456
await serverModule.spawnCli(await toCodeArgs(args))
5557
// Rather than have the caller handle errors and exit, spawnCli will exit

0 commit comments

Comments
 (0)