mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
propagate debug/inspect flags to typingsInstaller process
This commit is contained in:
parent
875e62cc75
commit
a1da7709f8
@ -183,9 +183,25 @@ namespace ts.server {
|
||||
|
||||
let args: string[] = [];
|
||||
if (this.logger.loggingEnabled() && this.logger.getLogFileName()) {
|
||||
args = [ "--logFile", combinePaths(getDirectoryPath(normalizeSlashes(this.logger.getLogFileName())), `ti-${process.pid}.log`) ];
|
||||
args.push("--logFile", combinePaths(getDirectoryPath(normalizeSlashes(this.logger.getLogFileName())), `ti-${process.pid}.log`));
|
||||
}
|
||||
this.installer = childProcess.fork(combinePaths(__dirname, "typingsInstaller.js"), args);
|
||||
let execArgv: string[] = [];
|
||||
{
|
||||
for (const arg of process.execArgv) {
|
||||
const match = /^--(debug|inspect)(=(\d+))?$/.exec(arg);
|
||||
if (match) {
|
||||
// if port is specified - use port + 1
|
||||
// otherwise pick a default port depending on if 'debug' or 'inspect' and use its value + 1
|
||||
let currentPort = match[3] !== undefined
|
||||
? +match[3]
|
||||
: match[1] === "debug" ? 5858 : 9229;
|
||||
execArgv.push(`--${match[1]}=${currentPort + 1}`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.installer = childProcess.fork(combinePaths(__dirname, "typingsInstaller.js"), args, { execArgv });
|
||||
this.installer.on("message", m => this.handleMessage(m));
|
||||
process.on("exit", () => {
|
||||
this.installer.kill();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user