Skip to content

Commit bc2a048

Browse files
committed
Handle --debug-brk and --inspect-brk when launching TypingsInstaller
1 parent 6f2d047 commit bc2a048

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/server/server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,13 @@ namespace ts.server {
349349

350350
const execArgv: string[] = [];
351351
for (const arg of process.execArgv) {
352-
const match = /^--(debug|inspect)(=(\d+))?$/.exec(arg);
352+
const match = /^--((?:debug|inspect)(?:-brk)?)(?:=(\d+))?$/.exec(arg);
353353
if (match) {
354354
// if port is specified - use port + 1
355355
// otherwise pick a default port depending on if 'debug' or 'inspect' and use its value + 1
356-
const currentPort = match[3] !== undefined
357-
? +match[3]
358-
: match[1] === "debug" ? 5858 : 9229;
356+
const currentPort = match[2] !== undefined
357+
? +match[2]
358+
: match[1].charAt(0) === "d" ? 5858 : 9229;
359359
execArgv.push(`--${match[1]}=${currentPort + 1}`);
360360
break;
361361
}

0 commit comments

Comments
 (0)