Skip to content

Commit f8a27c3

Browse files
committed
TraceServer: Only reset upon stop while pid not UP
Before this fix, stopping upon an already exited server -while still having the former pid stored- led to an extra stop act (with the inaccurate warning messages shown as a result). Simply, only internally reset in such a case, skipping the useless (and confusing) stopping act. Contributes to fixing #8. Signed-off-by: Marco Miller <marco.miller@ericsson.com>
1 parent 4017826 commit f8a27c3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/trace-server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ export class TraceServer {
2929
this.waitFor(context);
3030
}
3131

32-
stopOrReset(context: vscode.ExtensionContext | undefined) {
32+
async stopOrReset(context: vscode.ExtensionContext | undefined) {
3333
const pid: number | undefined = context?.workspaceState.get(key);
3434
const not = prefix + ' not stopped as none running or owned by us.';
3535
if (pid === none) {
3636
vscode.window.showWarningMessage(not);
3737
return;
3838
}
39-
if (pid) {
39+
if (pid && (await this.isUp())) {
4040
let id: NodeJS.Timeout;
4141
// recovering from workspaceState => no this.server set
4242
if (this.server) {

0 commit comments

Comments
 (0)