diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-02 19:14:00 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-02 19:14:00 +0100 |
commit | 01a54f094ba7c17a6788ec706f12b07d8d60af4b (patch) | |
tree | 65d4eed3620f65f8f349660adfc7fe91d6ef9910 /editors/code/src/commands/watch_status.ts | |
parent | 5cdf525caa51311515854c4dd398d3fb907d1368 (diff) | |
parent | 88bcaf0e1874f1552b1aa117bb78c3d237d2a953 (diff) |
Merge #1094
1094: Improve cargo-watch animation and refactoring r=matklad a=edwin0cheng
* Refactoring code and fixed some minor bugs.
* Add more error log and better error handling.
* Add current checking artifact name in Cargo-watch animation.
![new_status_animation](https://i.imgur.com/Zr2JLa5.gif)
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'editors/code/src/commands/watch_status.ts')
-rw-r--r-- | editors/code/src/commands/watch_status.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/editors/code/src/commands/watch_status.ts b/editors/code/src/commands/watch_status.ts index f027d7bbc..86ae821de 100644 --- a/editors/code/src/commands/watch_status.ts +++ b/editors/code/src/commands/watch_status.ts | |||
@@ -3,6 +3,8 @@ import * as vscode from 'vscode'; | |||
3 | const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']; | 3 | const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']; |
4 | 4 | ||
5 | export class StatusDisplay { | 5 | export class StatusDisplay { |
6 | public packageName?: string; | ||
7 | |||
6 | private i = 0; | 8 | private i = 0; |
7 | private statusBarItem: vscode.StatusBarItem; | 9 | private statusBarItem: vscode.StatusBarItem; |
8 | private timer?: NodeJS.Timeout; | 10 | private timer?: NodeJS.Timeout; |
@@ -17,10 +19,18 @@ export class StatusDisplay { | |||
17 | } | 19 | } |
18 | 20 | ||
19 | public show() { | 21 | public show() { |
22 | this.packageName = undefined; | ||
23 | |||
20 | this.timer = | 24 | this.timer = |
21 | this.timer || | 25 | this.timer || |
22 | setInterval(() => { | 26 | setInterval(() => { |
23 | this.statusBarItem!.text = 'cargo check ' + this.frame(); | 27 | if (this.packageName) { |
28 | this.statusBarItem!.text = `cargo check [${ | ||
29 | this.packageName | ||
30 | }] ${this.frame()}`; | ||
31 | } else { | ||
32 | this.statusBarItem!.text = `cargo check ${this.frame()}`; | ||
33 | } | ||
24 | }, 300); | 34 | }, 300); |
25 | 35 | ||
26 | this.statusBarItem!.show(); | 36 | this.statusBarItem!.show(); |