Skip to content

Commit c2a9a86

Browse files
authored
Delete --compatibility=1.63 code from the server (microsoft#183738)
1 parent 4ec04f4 commit c2a9a86

File tree

6 files changed

+1
-89
lines changed

6 files changed

+1
-89
lines changed

build/gulpfile.reh.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,6 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
309309
.pipe(replace('@@COMMIT@@', commit))
310310
.pipe(replace('@@APPNAME@@', product.applicationName))
311311
.pipe(rename(`bin/helpers/browser.cmd`)),
312-
gulp.src('resources/server/bin/server-old.cmd', { base: '.' })
313-
.pipe(rename(`server.cmd`)),
314312
gulp.src('resources/server/bin/code-server.cmd', { base: '.' })
315313
.pipe(rename(`bin/${product.serverApplicationName}.cmd`)),
316314
);
@@ -332,13 +330,6 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
332330
.pipe(rename(`bin/${product.serverApplicationName}`))
333331
.pipe(util.setExecutableBit())
334332
);
335-
if (type !== 'reh-web') {
336-
result = es.merge(result,
337-
gulp.src('resources/server/bin/server-old.sh', { base: '.' })
338-
.pipe(rename(`server.sh`))
339-
.pipe(util.setExecutableBit()),
340-
);
341-
}
342333
}
343334

344335
return result.pipe(vfs.dest(destination));

resources/server/bin/server-old.cmd

Lines changed: 0 additions & 24 deletions
This file was deleted.

resources/server/bin/server-old.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/server-main.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ async function start() {
4545
return;
4646
}
4747

48-
if (parsedArgs['compatibility'] === '1.63') {
49-
console.warn(`server.sh is being replaced by 'bin/${product.serverApplicationName}'. Please migrate to the new command and adopt the following new default behaviors:`);
50-
console.warn('* connection token is mandatory unless --without-connection-token is used');
51-
console.warn('* host defaults to `localhost`');
52-
}
53-
5448
/**
5549
* @typedef { import('./vs/server/node/remoteExtensionHostAgentServer').IServerAPI } IServerAPI
5650
*/

src/vs/server/node/serverConnectionToken.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@ export class NoneServerConnectionToken {
2929
}
3030
}
3131

32-
export class OptionalServerConnectionToken {
33-
public readonly type = ServerConnectionTokenType.Optional;
34-
35-
constructor(public readonly value: string) {
36-
}
37-
38-
public validate(connectionToken: any): boolean {
39-
return (connectionToken === this.value);
40-
}
41-
}
42-
4332
export class MandatoryServerConnectionToken {
4433
public readonly type = ServerConnectionTokenType.Mandatory;
4534

@@ -51,7 +40,7 @@ export class MandatoryServerConnectionToken {
5140
}
5241
}
5342

54-
export type ServerConnectionToken = NoneServerConnectionToken | OptionalServerConnectionToken | MandatoryServerConnectionToken;
43+
export type ServerConnectionToken = NoneServerConnectionToken | MandatoryServerConnectionToken;
5544

5645
export class ServerConnectionTokenParseError {
5746
constructor(
@@ -63,7 +52,6 @@ export async function parseServerConnectionToken(args: ServerParsedArgs, default
6352
const withoutConnectionToken = args['without-connection-token'];
6453
const connectionToken = args['connection-token'];
6554
const connectionTokenFile = args['connection-token-file'];
66-
const compatibility = (args['compatibility'] === '1.63');
6755

6856
if (withoutConnectionToken) {
6957
if (typeof connectionToken !== 'undefined' || typeof connectionTokenFile !== 'undefined') {
@@ -96,20 +84,9 @@ export async function parseServerConnectionToken(args: ServerParsedArgs, default
9684
return new ServerConnectionTokenParseError(`The connection token '${connectionToken} does not adhere to the characters 0-9, a-z, A-Z or -.`);
9785
}
9886

99-
if (compatibility) {
100-
// TODO: Remove this case soon
101-
return new OptionalServerConnectionToken(connectionToken);
102-
}
103-
10487
return new MandatoryServerConnectionToken(connectionToken);
10588
}
10689

107-
if (compatibility) {
108-
// TODO: Remove this case soon
109-
console.log(`Breaking change in the next release: Please use one of the following arguments: '--connection-token', '--connection-token-file' or '--without-connection-token'.`);
110-
return new OptionalServerConnectionToken(await defaultValue());
111-
}
112-
11390
return new MandatoryServerConnectionToken(await defaultValue());
11491
}
11592

src/vs/server/test/node/serverConnectionToken.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ suite('parseServerConnectionToken', () => {
2727
assert.ok(result.type === ServerConnectionTokenType.Mandatory);
2828
});
2929

30-
test('no arguments with --compatibility generates a token that is not mandatory', async () => {
31-
const result = await parseServerConnectionToken({ 'compatibility': '1.63' } as ServerParsedArgs, async () => 'defaultTokenValue');
32-
assert.ok(!(result instanceof ServerConnectionTokenParseError));
33-
assert.ok(result.type === ServerConnectionTokenType.Optional);
34-
assert.strictEqual(result.value, 'defaultTokenValue');
35-
});
36-
3730
test('--without-connection-token', async () => {
3831
const result = await parseServerConnectionToken({ 'without-connection-token': true } as ServerParsedArgs, async () => 'defaultTokenValue');
3932
assert.ok(!(result instanceof ServerConnectionTokenParseError));
@@ -74,11 +67,4 @@ suite('parseServerConnectionToken', () => {
7467
assert.strictEqual(result.value, connectionToken);
7568
});
7669

77-
test('--connection-token --compatibility marks a as not mandatory', async () => {
78-
const connectionToken = `12345-123-abc`;
79-
const result = await parseServerConnectionToken({ 'connection-token': connectionToken, 'compatibility': '1.63' } as ServerParsedArgs, async () => 'defaultTokenValue');
80-
assert.ok(!(result instanceof ServerConnectionTokenParseError));
81-
assert.ok(result.type === ServerConnectionTokenType.Optional);
82-
assert.strictEqual(result.value, connectionToken);
83-
});
8470
});

0 commit comments

Comments
 (0)