From 125a972c8174283d69f769ea9ad84014fa1ef286 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 6 May 2024 16:53:35 -0800 Subject: [PATCH] Do not add extra args in toCodeArgs It should only convert the args that are passed in. --- src/node/cli.ts | 11 ++++------- src/node/routes/vscode.ts | 4 ++++ test/unit/node/cli.test.ts | 2 -- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/node/cli.ts b/src/node/cli.ts index 7566bd9a0..fb24949f2 100644 --- a/src/node/cli.ts +++ b/src/node/cli.ts @@ -833,8 +833,8 @@ export interface CodeArgs extends UserProvidedCodeArgs { version: boolean "without-connection-token"?: boolean "without-browser-env-var"?: boolean - compatibility: string - log: string[] | undefined + compatibility?: string + log?: string[] } /** @@ -843,15 +843,12 @@ export interface CodeArgs extends UserProvidedCodeArgs { export type SpawnCodeCli = (args: CodeArgs) => Promise /** - * Convert our arguments to VS Code server arguments. + * Convert our arguments to equivalent VS Code server arguments. + * Does not add any extra arguments. */ export const toCodeArgs = async (args: DefaultedArgs): Promise => { return { ...args, - "accept-server-license-terms": true, - // This seems to be used to make the connection token flags optional (when - // set to 1.63) but we have always included them. - compatibility: "1.64", /** Type casting. */ help: !!args.help, version: !!args.version, diff --git a/src/node/routes/vscode.ts b/src/node/routes/vscode.ts index b8f88a0fc..8893dc80e 100644 --- a/src/node/routes/vscode.ts +++ b/src/node/routes/vscode.ts @@ -54,6 +54,10 @@ export const ensureVSCodeLoaded = async ( try { vscodeServer = await createVSServer(null, { ...(await toCodeArgs(req.args)), + "accept-server-license-terms": true, + // This seems to be used to make the connection token flags optional (when + // set to 1.63) but we have always included them. + compatibility: "1.64", "without-connection-token": true, }) } catch (error) { diff --git a/test/unit/node/cli.test.ts b/test/unit/node/cli.test.ts index 994697d2f..02b60b839 100644 --- a/test/unit/node/cli.test.ts +++ b/test/unit/node/cli.test.ts @@ -912,8 +912,6 @@ cert: false`) describe("toCodeArgs", () => { const vscodeDefaults = { ...defaults, - "accept-server-license-terms": true, - compatibility: "1.64", help: false, port: "8080", version: false,