aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands/watch_status.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/commands/watch_status.ts')
-rw-r--r--editors/code/src/commands/watch_status.ts18
1 files changed, 13 insertions, 5 deletions
diff --git a/editors/code/src/commands/watch_status.ts b/editors/code/src/commands/watch_status.ts
index 86ae821de..a3b0178f2 100644
--- a/editors/code/src/commands/watch_status.ts
+++ b/editors/code/src/commands/watch_status.ts
@@ -2,19 +2,18 @@ import * as vscode from 'vscode';
2 2
3const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']; 3const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
4 4
5export class StatusDisplay { 5export class StatusDisplay implements vscode.Disposable {
6 public packageName?: string; 6 public packageName?: string;
7 7
8 private i = 0; 8 private i = 0;
9 private statusBarItem: vscode.StatusBarItem; 9 private statusBarItem: vscode.StatusBarItem;
10 private timer?: NodeJS.Timeout; 10 private timer?: NodeJS.Timeout;
11 11
12 constructor(subscriptions: vscode.Disposable[]) { 12 constructor() {
13 this.statusBarItem = vscode.window.createStatusBarItem( 13 this.statusBarItem = vscode.window.createStatusBarItem(
14 vscode.StatusBarAlignment.Left, 14 vscode.StatusBarAlignment.Left,
15 10 15 10
16 ); 16 );
17 subscriptions.push(this.statusBarItem);
18 this.statusBarItem.hide(); 17 this.statusBarItem.hide();
19 } 18 }
20 19
@@ -33,7 +32,7 @@ export class StatusDisplay {
33 } 32 }
34 }, 300); 33 }, 300);
35 34
36 this.statusBarItem!.show(); 35 this.statusBarItem.show();
37 } 36 }
38 37
39 public hide() { 38 public hide() {
@@ -42,7 +41,16 @@ export class StatusDisplay {
42 this.timer = undefined; 41 this.timer = undefined;
43 } 42 }
44 43
45 this.statusBarItem!.hide(); 44 this.statusBarItem.hide();
45 }
46
47 public dispose() {
48 if (this.timer) {
49 clearInterval(this.timer);
50 this.timer = undefined;
51 }
52
53 this.statusBarItem.dispose();
46 } 54 }
47 55
48 private frame() { 56 private frame() {