Skip to content

Commit ba659b3

Browse files
committed
TraceServer: Show warnings upon no-op user command
Before this change, there was no feedback provided to the user, upon them issuing a no-op start/stop command. Add a warning message for each such case, showing the specific reason. Contributes to fixing #8. Signed-off-by: Marco Miller <marco.miller@ericsson.com>
1 parent 2c7c0f1 commit ba659b3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/trace-server.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ export class TraceServer {
3232

3333
stopOrReset(context: vscode.ExtensionContext | undefined) {
3434
const pid: number | undefined = context?.workspaceState.get(key);
35+
const not = prefix + ' not stopped as none running or owned by us.';
3536
if (pid === none) {
37+
vscode.window.showWarningMessage(not);
3638
return;
3739
}
3840
if (pid) {
@@ -62,6 +64,8 @@ export class TraceServer {
6264
});
6365
}
6466
);
67+
} else {
68+
vscode.window.showWarningMessage(not);
6569
}
6670
context?.workspaceState.update(key, none);
6771
this.server = undefined;
@@ -73,6 +77,8 @@ export class TraceServer {
7377
const foreigner = await this.isUp();
7478
if (stopped && !foreigner) {
7579
this.start(context);
80+
} else {
81+
vscode.window.showWarningMessage(prefix + ' not started as already running.');
7682
}
7783
}
7884

0 commit comments

Comments
 (0)