Skip to content

Commit c6e8733

Browse files
author
Andrew Hall (METAL)
committed
Merged PR 473387: Detached Process
Launch the language server process as detached. That way, when a user exits VS Code the process can exit gracefully. This enables sending session telemetry on exit.
1 parent c599e9f commit c6e8733

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
}
3636
},
3737
"defaults": {
38-
"roslyn": "4.7.0-2.23268.9",
38+
"roslyn": "4.7.0-2.23272.2",
3939
"omniSharp": "1.39.6",
4040
"razor": "7.0.0-preview.23269.1"
4141
},
@@ -4809,4 +4809,4 @@
48094809
}
48104810
]
48114811
}
4812-
}
4812+
}

src/lsptoolshost/roslynLanguageServer.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,18 @@ export class RoslynLanguageServer {
386386
args.push("--telemetryLevel", this.telemetryReporter.telemetryLevel);
387387

388388
let childProcess: cp.ChildProcessWithoutNullStreams;
389+
let cpOptions: cp.SpawnOptionsWithoutStdio = {
390+
detached: true,
391+
windowsHide: true
392+
};
393+
389394
if (serverPath.endsWith('.dll')) {
390395
// If we were given a path to a dll, launch that via dotnet.
391396
const argsWithPath = [ serverPath ].concat(args);
392-
childProcess = cp.spawn('dotnet', argsWithPath);
397+
childProcess = cp.spawn('dotnet', argsWithPath, cpOptions);
393398
} else {
394399
// Otherwise assume we were given a path to an executable.
395-
childProcess = cp.spawn(serverPath, args);
400+
childProcess = cp.spawn(serverPath, args, cpOptions);
396401
}
397402

398403
return childProcess;

0 commit comments

Comments
 (0)