mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 23:25:03 +00:00
cargo watch start and stop commands
This commit is contained in:
parent
0d39b1c3fa
commit
1ae6571762
5 changed files with 99 additions and 54 deletions
|
@ -2,19 +2,18 @@ import * as vscode from 'vscode';
|
|||
|
||||
const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
||||
|
||||
export class StatusDisplay {
|
||||
export class StatusDisplay implements vscode.Disposable {
|
||||
public packageName?: string;
|
||||
|
||||
private i = 0;
|
||||
private statusBarItem: vscode.StatusBarItem;
|
||||
private timer?: NodeJS.Timeout;
|
||||
|
||||
constructor(subscriptions: vscode.Disposable[]) {
|
||||
constructor() {
|
||||
this.statusBarItem = vscode.window.createStatusBarItem(
|
||||
vscode.StatusBarAlignment.Left,
|
||||
10
|
||||
);
|
||||
subscriptions.push(this.statusBarItem);
|
||||
this.statusBarItem.hide();
|
||||
}
|
||||
|
||||
|
@ -33,7 +32,7 @@ export class StatusDisplay {
|
|||
}
|
||||
}, 300);
|
||||
|
||||
this.statusBarItem!.show();
|
||||
this.statusBarItem.show();
|
||||
}
|
||||
|
||||
public hide() {
|
||||
|
@ -42,7 +41,16 @@ export class StatusDisplay {
|
|||
this.timer = undefined;
|
||||
}
|
||||
|
||||
this.statusBarItem!.hide();
|
||||
this.statusBarItem.hide();
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = undefined;
|
||||
}
|
||||
|
||||
this.statusBarItem.dispose();
|
||||
}
|
||||
|
||||
private frame() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue