diff options
author | Aleksei Sidorov <[email protected]> | 2019-06-24 11:50:34 +0100 |
---|---|---|
committer | Aleksei Sidorov <[email protected]> | 2019-06-24 11:50:34 +0100 |
commit | 28e9e8d4cfdf2a334cde6db7d10e7acb8f5fe8b1 (patch) | |
tree | fc7f452477d1483969ea45966d43e4545184a888 /editors/code/src | |
parent | c40ee089f221aa1be74614d7ad875488030e55ff (diff) |
Fix code after "apply suggestions"
Diffstat (limited to 'editors/code/src')
-rw-r--r-- | editors/code/src/commands/cargo_watch.ts | 12 | ||||
-rw-r--r-- | editors/code/src/commands/watch_status.ts | 4 | ||||
-rw-r--r-- | editors/code/src/config.ts | 16 |
3 files changed, 19 insertions, 13 deletions
diff --git a/editors/code/src/commands/cargo_watch.ts b/editors/code/src/commands/cargo_watch.ts index 16aac3758..13adf4c10 100644 --- a/editors/code/src/commands/cargo_watch.ts +++ b/editors/code/src/commands/cargo_watch.ts | |||
@@ -43,7 +43,9 @@ 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(Server.config.cargoWatchOptions.checkCommand); | 46 | this.statusDisplay = new StatusDisplay( |
47 | Server.config.cargoWatchOptions.command | ||
48 | ); | ||
47 | this.outputChannel = vscode.window.createOutputChannel( | 49 | this.outputChannel = vscode.window.createOutputChannel( |
48 | 'Cargo Watch Trace' | 50 | 'Cargo Watch Trace' |
49 | ); | 51 | ); |
@@ -57,10 +59,12 @@ export class CargoWatchProvider implements vscode.Disposable { | |||
57 | return; | 59 | return; |
58 | } | 60 | } |
59 | 61 | ||
60 | let args = Server.config.cargoWatchOptions.checkCommand + ' --all-targets --message-format json'; | 62 | let args = |
61 | if (Server.config.cargoWatchOptions.checkArguments.length > 0) { | 63 | Server.config.cargoWatchOptions.command + |
64 | ' --all-targets --message-format json'; | ||
65 | if (Server.config.cargoWatchOptions.command.length > 0) { | ||
62 | // Excape the double quote string: | 66 | // Excape the double quote string: |
63 | args += ' ' + Server.config.cargoWatchOptions.checkArguments; | 67 | args += ' ' + Server.config.cargoWatchOptions.arguments; |
64 | } | 68 | } |
65 | // Windows handles arguments differently than the unix-likes, so we need to wrap the args in double quotes | 69 | // Windows handles arguments differently than the unix-likes, so we need to wrap the args in double quotes |
66 | if (process.platform === 'win32') { | 70 | if (process.platform === 'win32') { |
diff --git a/editors/code/src/commands/watch_status.ts b/editors/code/src/commands/watch_status.ts index 91bc7195b..6c1f9041b 100644 --- a/editors/code/src/commands/watch_status.ts +++ b/editors/code/src/commands/watch_status.ts | |||
@@ -30,7 +30,9 @@ export class StatusDisplay implements vscode.Disposable { | |||
30 | this.packageName | 30 | this.packageName |
31 | }] ${this.frame()}`; | 31 | }] ${this.frame()}`; |
32 | } else { | 32 | } else { |
33 | this.statusBarItem!.text = `cargo ${this.command} ${this.frame()}`; | 33 | this.statusBarItem!.text = `cargo ${ |
34 | this.command | ||
35 | } ${this.frame()}`; | ||
34 | } | 36 | } |
35 | }, 300); | 37 | }, 300); |
36 | 38 | ||
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index c1dd2c056..10e98d753 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -25,8 +25,8 @@ export class Config { | |||
25 | public cargoWatchOptions: CargoWatchOptions = { | 25 | public cargoWatchOptions: CargoWatchOptions = { |
26 | enableOnStartup: 'ask', | 26 | enableOnStartup: 'ask', |
27 | trace: 'off', | 27 | trace: 'off', |
28 | checkArguments: '', | 28 | arguments: '', |
29 | checkCommand: '' | 29 | command: '' |
30 | }; | 30 | }; |
31 | 31 | ||
32 | private prevEnhancedTyping: null | boolean = null; | 32 | private prevEnhancedTyping: null | boolean = null; |
@@ -107,16 +107,16 @@ export class Config { | |||
107 | ); | 107 | ); |
108 | } | 108 | } |
109 | 109 | ||
110 | if (config.has('cargo-watch.check-arguments')) { | 110 | if (config.has('cargo-watch.arguments')) { |
111 | this.cargoWatchOptions.checkArguments = config.get<string>( | 111 | this.cargoWatchOptions.arguments = config.get<string>( |
112 | 'cargo-watch.check-arguments', | 112 | 'cargo-watch.arguments', |
113 | '' | 113 | '' |
114 | ); | 114 | ); |
115 | } | 115 | } |
116 | 116 | ||
117 | if (config.has('cargo-watch.check-command')) { | 117 | if (config.has('cargo-watch.command')) { |
118 | this.cargoWatchOptions.checkCommand = config.get<string>( | 118 | this.cargoWatchOptions.command = config.get<string>( |
119 | 'cargo-watch.check-command', | 119 | 'cargo-watch.command', |
120 | '' | 120 | '' |
121 | ); | 121 | ); |
122 | } | 122 | } |