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
"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<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> => {
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,

View File

@ -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) {

View File

@ -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,