Skip to content

Commit 99352b6

Browse files
committed
restore old ext host debug port logic, microsoft#39569
1 parent 36b323b commit 99352b6

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/vs/platform/environment/node/environmentService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,16 @@ export class EnvironmentService implements IEnvironmentService {
173173
}
174174

175175
export function parseExtensionHostPort(args: ParsedArgs, isBuild: boolean): IExtensionHostDebugParams {
176-
return parseDebugPort(args.debugPluginHost, args.debugBrkPluginHost, 5870, args.debugId);
176+
return parseDebugPort(args.debugPluginHost, args.debugBrkPluginHost, 5870, isBuild, args.debugId);
177177
}
178178

179179
export function parseSearchPort(args: ParsedArgs, isBuild: boolean): IDebugParams {
180-
return parseDebugPort(args.debugSearch, args.debugBrkSearch, !isBuild ? 5876 : null);
180+
return parseDebugPort(args.debugSearch, args.debugBrkSearch, 5876, isBuild);
181181
}
182182

183-
export function parseDebugPort(debugArg: string, debugBrkArg: string, defaultBuildPort: number, debugId?: string): IExtensionHostDebugParams {
183+
export function parseDebugPort(debugArg: string, debugBrkArg: string, defaultBuildPort: number, isBuild: boolean, debugId?: string): IExtensionHostDebugParams {
184184
const portStr = debugBrkArg || debugArg;
185-
const port = Number(portStr) || defaultBuildPort;
185+
const port = Number(portStr) || (!isBuild ? defaultBuildPort : null);
186186
const brk = port ? Boolean(!!debugBrkArg) : false;
187187
return { port, break: brk, debugId };
188188
}

src/vs/platform/environment/test/node/environmentService.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ suite('EnvironmentService', () => {
1414
test('parseExtensionHostPort when built', () => {
1515
const parse = a => parseExtensionHostPort(parseArgs(a), true);
1616

17-
assert.deepEqual(parse([]), { port: 5870, break: false, debugId: undefined });
18-
assert.deepEqual(parse(['--debugPluginHost']), { port: 5870, break: false, debugId: undefined });
17+
assert.deepEqual(parse([]), { port: null, break: false, debugId: undefined });
18+
assert.deepEqual(parse(['--debugPluginHost']), { port: null, break: false, debugId: undefined });
1919
assert.deepEqual(parse(['--debugPluginHost=1234']), { port: 1234, break: false, debugId: undefined });
20-
assert.deepEqual(parse(['--debugBrkPluginHost']), { port: 5870, break: false, debugId: undefined });
20+
assert.deepEqual(parse(['--debugBrkPluginHost']), { port: null, break: false, debugId: undefined });
2121
assert.deepEqual(parse(['--debugBrkPluginHost=5678']), { port: 5678, break: true, debugId: undefined });
2222
assert.deepEqual(parse(['--debugPluginHost=1234', '--debugBrkPluginHost=5678', '--debugId=7']), { port: 5678, break: true, debugId: '7' });
2323
});

0 commit comments

Comments
 (0)