Skip to content

Commit 125a972

Browse files
committed
Do not add extra args in toCodeArgs
It should only convert the args that are passed in.
1 parent 7050002 commit 125a972

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/node/cli.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -833,8 +833,8 @@ export interface CodeArgs extends UserProvidedCodeArgs {
833833
version: boolean
834834
"without-connection-token"?: boolean
835835
"without-browser-env-var"?: boolean
836-
compatibility: string
837-
log: string[] | undefined
836+
compatibility?: string
837+
log?: string[]
838838
}
839839

840840
/**
@@ -843,15 +843,12 @@ export interface CodeArgs extends UserProvidedCodeArgs {
843843
export type SpawnCodeCli = (args: CodeArgs) => Promise<void>
844844

845845
/**
846-
* Convert our arguments to VS Code server arguments.
846+
* Convert our arguments to equivalent VS Code server arguments.
847+
* Does not add any extra arguments.
847848
*/
848849
export const toCodeArgs = async (args: DefaultedArgs): Promise<CodeArgs> => {
849850
return {
850851
...args,
851-
"accept-server-license-terms": true,
852-
// This seems to be used to make the connection token flags optional (when
853-
// set to 1.63) but we have always included them.
854-
compatibility: "1.64",
855852
/** Type casting. */
856853
help: !!args.help,
857854
version: !!args.version,

src/node/routes/vscode.ts

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ export const ensureVSCodeLoaded = async (
5454
try {
5555
vscodeServer = await createVSServer(null, {
5656
...(await toCodeArgs(req.args)),
57+
"accept-server-license-terms": true,
58+
// This seems to be used to make the connection token flags optional (when
59+
// set to 1.63) but we have always included them.
60+
compatibility: "1.64",
5761
"without-connection-token": true,
5862
})
5963
} catch (error) {

test/unit/node/cli.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,6 @@ cert: false`)
912912
describe("toCodeArgs", () => {
913913
const vscodeDefaults = {
914914
...defaults,
915-
"accept-server-license-terms": true,
916-
compatibility: "1.64",
917915
help: false,
918916
port: "8080",
919917
version: false,

0 commit comments

Comments
 (0)