Skip to content

Commit

Permalink
Allow TS Server to be started with --inspect-brk (#98340)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch authored May 26, 2020
1 parent 478ba18 commit 766e520
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ export class TypeScriptServerSpawner {

private getForkOptions(kind: ServerKind, configuration: TypeScriptServiceConfiguration) {
const debugPort = TypeScriptServerSpawner.getDebugPort(kind);
const inspectFlag = process.env['TSS_DEBUG_BRK'] ? '--inspect-brk' : '--inspect';
const tsServerForkOptions: electron.ForkOptions = {
execArgv: [
...(debugPort ? [`--inspect=${debugPort}`] : []),
...(debugPort ? [`${inspectFlag}=${debugPort}`] : []),
...(configuration.maxTsServerMemory ? [`--max-old-space-size=${configuration.maxTsServerMemory}`] : [])
]
};
Expand Down Expand Up @@ -200,7 +201,7 @@ export class TypeScriptServerSpawner {
// We typically only want to debug the main semantic server
return undefined;
}
const value = process.env['TSS_DEBUG'];
const value = process.env['TSS_DEBUG_BRK'] || process.env['TSS_DEBUG'];
if (value) {
const port = parseInt(value);
if (!isNaN(port)) {
Expand Down

0 comments on commit 766e520

Please # to comment.