Do not add extra args in toCodeArgs
It should only convert the args that are passed in.
This commit is contained in:
parent
7050002fb6
commit
125a972c81
@ -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,
|
||||
|
@ -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) {
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user