Skip to content

Commit be99123

Browse files
committed
TraceServer: Show messages about started/stopped
Such informational messages show as sticky, thus each has to be closed by the user. These messages are likely more useful when [1] below isn't installed alongside this extension. Meaning, when [1]'s provided server status bar item isn't present to show similar statuses. [1] https://github.com/eclipse-cdt-cloud/vscode-trace-extension Fixes #7. Signed-off-by: Marco Miller <marco.miller@ericsson.com>
1 parent ade4492 commit be99123

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/trace-server.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class TraceServer {
4141
// recovering from workspaceState => no this.server set
4242
if (this.server) {
4343
this.server.once(exit, () => {
44-
this.setStatusIfAvailable(false);
44+
this.showStatus(false);
4545
clearTimeout(id);
4646
});
4747
}
@@ -132,7 +132,7 @@ export class TraceServer {
132132
const status = health.getModel()?.status;
133133

134134
if (health.isOk() && status === 'UP') {
135-
this.setStatusIfAvailable(true);
135+
this.showStatus(true);
136136
this.server?.once(exit, () => {
137137
this.stopOrReset(context);
138138
});
@@ -149,6 +149,15 @@ export class TraceServer {
149149
);
150150
}
151151

152+
private showStatus(started: boolean) {
153+
if (started) {
154+
vscode.window.showInformationMessage(prefix + ': Started.');
155+
} else {
156+
vscode.window.showInformationMessage(prefix + ': Stopped.');
157+
}
158+
this.setStatusIfAvailable(started);
159+
}
160+
152161
private setStatusIfAvailable(started: boolean) {
153162
const fromTraceExtension = 'serverStatus';
154163
if (started) {

0 commit comments

Comments
 (0)