From 4722e6d491a29bdb077fc01aa8c5bdc734282c69 Mon Sep 17 00:00:00 2001 From: Aleksei Sidorov Date: Mon, 24 Jun 2019 13:02:20 +0300 Subject: Introduce cargo-watch.check-command --- editors/code/src/commands/cargo_watch.ts | 6 ++++-- editors/code/src/commands/watch_status.ts | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'editors/code/src/commands') diff --git a/editors/code/src/commands/cargo_watch.ts b/editors/code/src/commands/cargo_watch.ts index 6ba794bb3..db92e03f4 100644 --- a/editors/code/src/commands/cargo_watch.ts +++ b/editors/code/src/commands/cargo_watch.ts @@ -43,7 +43,7 @@ export class CargoWatchProvider implements vscode.Disposable { this.diagnosticCollection = vscode.languages.createDiagnosticCollection( 'rustc' ); - this.statusDisplay = new StatusDisplay(); + this.statusDisplay = new StatusDisplay(Server.config.cargoWatchOptions.checkCommand); this.outputChannel = vscode.window.createOutputChannel( 'Cargo Watch Trace' ); @@ -57,7 +57,9 @@ export class CargoWatchProvider implements vscode.Disposable { return; } - let args = 'check --all-targets --message-format json'; + let command = Server.config.cargoWatchOptions.checkCommand; + + let args = command + ' --all-targets --message-format json'; if (Server.config.cargoWatchOptions.checkArguments.length > 0) { // Excape the double quote string: args += ' ' + Server.config.cargoWatchOptions.checkArguments; diff --git a/editors/code/src/commands/watch_status.ts b/editors/code/src/commands/watch_status.ts index a3b0178f2..91bc7195b 100644 --- a/editors/code/src/commands/watch_status.ts +++ b/editors/code/src/commands/watch_status.ts @@ -7,13 +7,15 @@ export class StatusDisplay implements vscode.Disposable { private i = 0; private statusBarItem: vscode.StatusBarItem; + private command: string; private timer?: NodeJS.Timeout; - constructor() { + constructor(command: string) { this.statusBarItem = vscode.window.createStatusBarItem( vscode.StatusBarAlignment.Left, 10 ); + this.command = command; this.statusBarItem.hide(); } @@ -24,11 +26,11 @@ export class StatusDisplay implements vscode.Disposable { this.timer || setInterval(() => { if (this.packageName) { - this.statusBarItem!.text = `cargo check [${ + this.statusBarItem!.text = `cargo ${this.command} [${ this.packageName }] ${this.frame()}`; } else { - this.statusBarItem!.text = `cargo check ${this.frame()}`; + this.statusBarItem!.text = `cargo ${this.command} ${this.frame()}`; } }, 300); -- cgit v1.2.3