mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-25 04:07:37 +00:00
Restore automatically putting TS Server in debug more if TSS_DEBUG is set
Fixes https://github.com/Microsoft/TypeScript/issues/21454
This commit is contained in:
@@ -354,8 +354,9 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
|
||||
return this.servicePromise = new Promise<ForkedTsServerProcess>(async (resolve, reject) => {
|
||||
try {
|
||||
const tsServerForkArgs = await this.getTsServerArgs(currentVersion);
|
||||
const debugPort = this.getDebugPort();
|
||||
const tsServerForkOptions: electron.IForkOptions = {
|
||||
execArgv: [] // [`--debug-brk=5859`]
|
||||
execArgv: debugPort ? [`--inspect=${debugPort}`] : [] // [`--debug-brk=5859`]
|
||||
};
|
||||
electron.fork(currentVersion.tsServerPath, tsServerForkArgs, tsServerForkOptions, this.logger, (err: any, childProcess: cp.ChildProcess | null) => {
|
||||
if (err || !childProcess) {
|
||||
@@ -942,6 +943,18 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
|
||||
return args;
|
||||
}
|
||||
|
||||
|
||||
private getDebugPort(): number | undefined {
|
||||
const value = process.env['TSS_DEBUG'];
|
||||
if (value) {
|
||||
const port = parseInt(value);
|
||||
if (!isNaN(port)) {
|
||||
return port;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private resetClientVersion() {
|
||||
this._apiVersion = API.defaultVersion;
|
||||
this._tsserverVersion = undefined;
|
||||
|
||||
Reference in New Issue
Block a user