Fix import of server-main.js from main

Neglected to update this import when fixing the other.
This commit is contained in:
Asher 2024-10-18 10:06:57 -08:00
parent fc6064dcd3
commit 7c298653f1
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
1 changed files with 3 additions and 1 deletions

View File

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