aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands
diff options
context:
space:
mode:
authorAleksei Sidorov <[email protected]>2019-06-24 11:02:20 +0100
committerAleksei Sidorov <[email protected]>2019-06-24 11:02:20 +0100
commit4722e6d491a29bdb077fc01aa8c5bdc734282c69 (patch)
tree681b4fd62ce9b2166180713236254a8a25f2b60f /editors/code/src/commands
parent7d79be32801036c39507fe96f87ed316e3934662 (diff)
Introduce cargo-watch.check-command
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r--editors/code/src/commands/cargo_watch.ts6
-rw-r--r--editors/code/src/commands/watch_status.ts8
2 files changed, 9 insertions, 5 deletions
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 {
43 this.diagnosticCollection = vscode.languages.createDiagnosticCollection( 43 this.diagnosticCollection = vscode.languages.createDiagnosticCollection(
44 'rustc' 44 'rustc'
45 ); 45 );
46 this.statusDisplay = new StatusDisplay(); 46 this.statusDisplay = new StatusDisplay(Server.config.cargoWatchOptions.checkCommand);
47 this.outputChannel = vscode.window.createOutputChannel( 47 this.outputChannel = vscode.window.createOutputChannel(
48 'Cargo Watch Trace' 48 'Cargo Watch Trace'
49 ); 49 );
@@ -57,7 +57,9 @@ export class CargoWatchProvider implements vscode.Disposable {
57 return; 57 return;
58 } 58 }
59 59
60 let args = 'check --all-targets --message-format json'; 60 let command = Server.config.cargoWatchOptions.checkCommand;
61
62 let args = command + ' --all-targets --message-format json';
61 if (Server.config.cargoWatchOptions.checkArguments.length > 0) { 63 if (Server.config.cargoWatchOptions.checkArguments.length > 0) {
62 // Excape the double quote string: 64 // Excape the double quote string:
63 args += ' ' + Server.config.cargoWatchOptions.checkArguments; 65 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 {
7 7
8 private i = 0; 8 private i = 0;
9 private statusBarItem: vscode.StatusBarItem; 9 private statusBarItem: vscode.StatusBarItem;
10 private command: string;
10 private timer?: NodeJS.Timeout; 11 private timer?: NodeJS.Timeout;
11 12
12 constructor() { 13 constructor(command: string) {
13 this.statusBarItem = vscode.window.createStatusBarItem( 14 this.statusBarItem = vscode.window.createStatusBarItem(
14 vscode.StatusBarAlignment.Left, 15 vscode.StatusBarAlignment.Left,
15 10 16 10
16 ); 17 );
18 this.command = command;
17 this.statusBarItem.hide(); 19 this.statusBarItem.hide();
18 } 20 }
19 21
@@ -24,11 +26,11 @@ export class StatusDisplay implements vscode.Disposable {
24 this.timer || 26 this.timer ||
25 setInterval(() => { 27 setInterval(() => {
26 if (this.packageName) { 28 if (this.packageName) {
27 this.statusBarItem!.text = `cargo check [${ 29 this.statusBarItem!.text = `cargo ${this.command} [${
28 this.packageName 30 this.packageName
29 }] ${this.frame()}`; 31 }] ${this.frame()}`;
30 } else { 32 } else {
31 this.statusBarItem!.text = `cargo check ${this.frame()}`; 33 this.statusBarItem!.text = `cargo ${this.command} ${this.frame()}`;
32 } 34 }
33 }, 300); 35 }, 300);
34 36