Archived
1
0

Do not add extra args in toCodeArgs

It should only convert the args that are passed in.
This commit is contained in:
Asher 2024-05-06 16:53:35 -08:00
parent 7050002fb6
commit 125a972c81
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
3 changed files with 8 additions and 9 deletions

View File

@ -833,8 +833,8 @@ export interface CodeArgs extends UserProvidedCodeArgs {
version: boolean version: boolean
"without-connection-token"?: boolean "without-connection-token"?: boolean
"without-browser-env-var"?: boolean "without-browser-env-var"?: boolean
compatibility: string compatibility?: string
log: string[] | undefined log?: string[]
} }
/** /**
@ -843,15 +843,12 @@ export interface CodeArgs extends UserProvidedCodeArgs {
export type SpawnCodeCli = (args: CodeArgs) => Promise<void> export type SpawnCodeCli = (args: CodeArgs) => Promise<void>
/** /**
* 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<CodeArgs> => { export const toCodeArgs = async (args: DefaultedArgs): Promise<CodeArgs> => {
return { return {
...args, ...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. */ /** Type casting. */
help: !!args.help, help: !!args.help,
version: !!args.version, version: !!args.version,

View File

@ -54,6 +54,10 @@ export const ensureVSCodeLoaded = async (
try { try {
vscodeServer = await createVSServer(null, { vscodeServer = await createVSServer(null, {
...(await toCodeArgs(req.args)), ...(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, "without-connection-token": true,
}) })
} catch (error) { } catch (error) {

View File

@ -912,8 +912,6 @@ cert: false`)
describe("toCodeArgs", () => { describe("toCodeArgs", () => {
const vscodeDefaults = { const vscodeDefaults = {
...defaults, ...defaults,
"accept-server-license-terms": true,
compatibility: "1.64",
help: false, help: false,
port: "8080", port: "8080",
version: false, version: false,