diff --git a/src/server/server.ts b/src/server/server.ts index 2f98db89833..b52db6f517e 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -181,18 +181,18 @@ namespace ts.server { this.logger.info("Binding..."); } - let args: string[] = []; + const args: string[] = []; if (this.logger.loggingEnabled() && this.logger.getLogFileName()) { args.push("--logFile", combinePaths(getDirectoryPath(normalizeSlashes(this.logger.getLogFileName())), `ti-${process.pid}.log`)); } - let execArgv: string[] = []; + const 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 + const currentPort = match[3] !== undefined ? +match[3] : match[1] === "debug" ? 5858 : 9229; execArgv.push(`--${match[1]}=${currentPort + 1}`); @@ -200,7 +200,7 @@ namespace ts.server { } } } - + this.installer = childProcess.fork(combinePaths(__dirname, "typingsInstaller.js"), args, { execArgv }); this.installer.on("message", m => this.handleMessage(m)); process.on("exit", () => {