diff options
author | Edwin Cheng <[email protected]> | 2019-03-31 14:21:14 +0100 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-04-02 08:03:30 +0100 |
commit | c894a3e19b0e658622a03a7d0539a78a433b42ae (patch) | |
tree | 687f625980861712afb024aec8af4718c1c900a7 /editors/code/src/commands/cargo_watch.ts | |
parent | 6971c7f1185fb7c1c0ce5f19867b999de71b5937 (diff) |
Fix prettier error
Diffstat (limited to 'editors/code/src/commands/cargo_watch.ts')
-rw-r--r-- | editors/code/src/commands/cargo_watch.ts | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/editors/code/src/commands/cargo_watch.ts b/editors/code/src/commands/cargo_watch.ts index c6ce6ba06..037f1e302 100644 --- a/editors/code/src/commands/cargo_watch.ts +++ b/editors/code/src/commands/cargo_watch.ts | |||
@@ -2,7 +2,7 @@ import * as child_process from 'child_process'; | |||
2 | import * as path from 'path'; | 2 | import * as path from 'path'; |
3 | import * as timers from 'timers'; | 3 | import * as timers from 'timers'; |
4 | import * as vscode from 'vscode'; | 4 | import * as vscode from 'vscode'; |
5 | import {StatusDisplay} from './watch_status'; | 5 | import { StatusDisplay } from './watch_status'; |
6 | 6 | ||
7 | export class CargoWatchProvider { | 7 | export class CargoWatchProvider { |
8 | private diagnosticCollection?: vscode.DiagnosticCollection; | 8 | private diagnosticCollection?: vscode.DiagnosticCollection; |
@@ -12,19 +12,22 @@ export class CargoWatchProvider { | |||
12 | 12 | ||
13 | public activate(subscriptions: vscode.Disposable[]) { | 13 | public activate(subscriptions: vscode.Disposable[]) { |
14 | subscriptions.push(this); | 14 | subscriptions.push(this); |
15 | this.diagnosticCollection = vscode.languages.createDiagnosticCollection('rustc'); | 15 | this.diagnosticCollection = vscode.languages.createDiagnosticCollection( |
16 | 'rustc' | ||
17 | ); | ||
16 | 18 | ||
17 | this.statusDisplay = new StatusDisplay(subscriptions); | 19 | this.statusDisplay = new StatusDisplay(subscriptions); |
18 | 20 | ||
19 | // Start the cargo watch with json message | 21 | // Start the cargo watch with json message |
20 | this.cargoProcess = child_process.spawn('cargo', | 22 | this.cargoProcess = child_process.spawn( |
21 | ['watch', '-x', '\"check --message-format json\"'], | 23 | 'cargo', |
24 | ['watch', '-x', '"check --message-format json"'], | ||
22 | { | 25 | { |
23 | // stdio: ['ignore', 'pipe', 'ignore'], | 26 | // stdio: ['ignore', 'pipe', 'ignore'], |
24 | shell: true, | 27 | shell: true, |
25 | cwd: vscode.workspace.rootPath, | 28 | cwd: vscode.workspace.rootPath |
26 | }); | 29 | } |
27 | 30 | ); | |
28 | 31 | ||
29 | this.cargoProcess.stdout.on('data', (s: string) => { | 32 | this.cargoProcess.stdout.on('data', (s: string) => { |
30 | this.processOutput(s); | 33 | this.processOutput(s); |
@@ -109,7 +112,9 @@ export class CargoWatchProvider { | |||
109 | 112 | ||
110 | const fileUrl = vscode.Uri.file(fileName!); | 113 | const fileUrl = vscode.Uri.file(fileName!); |
111 | 114 | ||
112 | const diagnostics: vscode.Diagnostic[] = [...(this.diagnosticCollection!.get(fileUrl) || [])]; | 115 | const diagnostics: vscode.Diagnostic[] = [ |
116 | ...(this.diagnosticCollection!.get(fileUrl) || []) | ||
117 | ]; | ||
113 | diagnostics.push(diagnostic); | 118 | diagnostics.push(diagnostic); |
114 | 119 | ||
115 | this.diagnosticCollection!.set(fileUrl, diagnostics); | 120 | this.diagnosticCollection!.set(fileUrl, diagnostics); |
@@ -129,5 +134,4 @@ export class CargoWatchProvider { | |||
129 | eolIndex = this.outBuffer.indexOf('\n'); | 134 | eolIndex = this.outBuffer.indexOf('\n'); |
130 | } | 135 | } |
131 | } | 136 | } |
132 | |||
133 | } | 137 | } |