mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-16 22:14:20 -05:00
Do not force that a connection token CLI argument is present
This commit is contained in:
@@ -104,5 +104,5 @@ export function parseServerConnectionToken(args: ServerParsedArgs): ServerConnec
|
||||
return new OptionalServerConnectionToken(generateUuid());
|
||||
}
|
||||
|
||||
return new ServerConnectionTokenParseError(`Please use one of the following arguments: '--connection-token', '--connection-token-file' or '--without-connection-token'.`);
|
||||
return new MandatoryServerConnectionToken(generateUuid());
|
||||
}
|
||||
|
||||
@@ -21,8 +21,10 @@ suite('parseServerConnectionToken', () => {
|
||||
assert.strictEqual(isError(r), true);
|
||||
}
|
||||
|
||||
test('no arguments results in error', () => {
|
||||
assertIsError(parseServerConnectionToken({} as ServerParsedArgs));
|
||||
test('no arguments generates a token that is mandatory', () => {
|
||||
const result = parseServerConnectionToken({} as ServerParsedArgs);
|
||||
assert.ok(!(result instanceof ServerConnectionTokenParseError));
|
||||
assert.ok(result.type === ServerConnectionTokenType.Mandatory);
|
||||
});
|
||||
|
||||
test('no arguments with --compatibility generates a token that is not mandatory', () => {
|
||||
|
||||
@@ -14,7 +14,6 @@ import * as kill from 'tree-kill';
|
||||
import { PageFunction } from 'playwright-core/types/structs';
|
||||
import { Logger, measureAndLog } from './logger';
|
||||
import type { LaunchOptions } from './code';
|
||||
import * as crypto from 'crypto';
|
||||
|
||||
const width = 1200;
|
||||
const height = 800;
|
||||
@@ -225,7 +224,7 @@ async function launchServer(options: LaunchOptions) {
|
||||
...process.env
|
||||
};
|
||||
|
||||
const args = ['--connection-token', String(crypto.randomInt(0xffffffff)), '--disable-telemetry', '--port', `${port++}`, '--driver', 'web', '--extensions-dir', extensionsPath, '--server-data-dir', agentFolder];
|
||||
const args = ['--disable-telemetry', '--port', `${port++}`, '--driver', 'web', '--extensions-dir', extensionsPath, '--server-data-dir', agentFolder];
|
||||
|
||||
let serverLocation: string | undefined;
|
||||
if (codeServerPath) {
|
||||
|
||||
Reference in New Issue
Block a user