diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-02 11:10:26 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-02 11:10:26 +0100 |
commit | bb3b159fb7d377f667732ade715cbe019da84d71 (patch) | |
tree | 2cfb500a2eec37f1689ec9448babbbfedc28fba0 /editors/code/package.json | |
parent | b0d244719323d68905986857844f56d1fa38cac4 (diff) | |
parent | b60e2f779b28f654dbd5a2657c668de8452933c6 (diff) |
Merge #1079
1079: Improve cargo-watch usage in vscode plugin r=matklad a=edwin0cheng
*This PR try to improve current cargo-watch usage in VSCode :*
1. Add Multi-lines error support :
![multilines-error](https://i.imgur.com/gbLEwMG.gif)
2. Add cargo-watch status animation :
![cargo-watch-status](https://i.imgur.com/GbHwzjj.gif)
*Implementation Details*
* Current VSCode `ProblemMatcher` still do not support multiple line parsing.
* However we can, spawn a cargo watch process instead of using vscode.Task to allow more control.
* Use `cargo-check --message-format json` to get json format of compiler-message.
* Use `vscode.DiagnosticCollection` to manage the problems directly, which allow multiple lines diagnostic.
However,
* VSCode use non mono-space font for problems, at this moment i cannot find a good solution about it.
* I am not so good in typescript, please let me know if anything is bad in this PR.
Co-authored-by: Edwin Cheng <[email protected]>
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'editors/code/package.json')
-rw-r--r-- | editors/code/package.json | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index facb633d9..1c8caaa60 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -18,7 +18,7 @@ | |||
18 | "scripts": { | 18 | "scripts": { |
19 | "vscode:prepublish": "npm run compile", | 19 | "vscode:prepublish": "npm run compile", |
20 | "package": "vsce package", | 20 | "package": "vsce package", |
21 | "compile": "tsc -p ./", | 21 | "compile": "tsc -p ./ && shx cp src/utils/terminateProcess.sh out/utils/terminateProcess.sh", |
22 | "watch": "tsc -watch -p ./", | 22 | "watch": "tsc -watch -p ./", |
23 | "postinstall": "node ./node_modules/vscode/bin/install", | 23 | "postinstall": "node ./node_modules/vscode/bin/install", |
24 | "fix": "prettier **/*.{json,ts} --write && tslint --project . --fix", | 24 | "fix": "prettier **/*.{json,ts} --write && tslint --project . --fix", |
@@ -41,7 +41,8 @@ | |||
41 | "tslint-config-prettier": "^1.18.0", | 41 | "tslint-config-prettier": "^1.18.0", |
42 | "typescript": "^3.3.1", | 42 | "typescript": "^3.3.1", |
43 | "vsce": "^1.57.0", | 43 | "vsce": "^1.57.0", |
44 | "vscode": "^1.1.29" | 44 | "vscode": "^1.1.29", |
45 | "shx": "^0.3.1" | ||
45 | }, | 46 | }, |
46 | "activationEvents": [ | 47 | "activationEvents": [ |
47 | "onLanguage:rust", | 48 | "onLanguage:rust", |
@@ -183,6 +184,11 @@ | |||
183 | ], | 184 | ], |
184 | "description": "Whether to run `cargo watch` on startup" | 185 | "description": "Whether to run `cargo watch` on startup" |
185 | }, | 186 | }, |
187 | "rust-analyzer.cargo-watch.check-arguments": { | ||
188 | "type": "string", | ||
189 | "description": "`cargo-watch` check arguments. (e.g: `--features=\"shumway,pdf\"` will run as `cargo watch -x \"check --features=\"shumway,pdf\"\"` )", | ||
190 | "default": "" | ||
191 | }, | ||
186 | "rust-analyzer.trace.server": { | 192 | "rust-analyzer.trace.server": { |
187 | "type": "string", | 193 | "type": "string", |
188 | "scope": "window", | 194 | "scope": "window", |
@@ -191,8 +197,24 @@ | |||
191 | "messages", | 197 | "messages", |
192 | "verbose" | 198 | "verbose" |
193 | ], | 199 | ], |
200 | "enumDescriptions": [ | ||
201 | "No traces", | ||
202 | "Error only", | ||
203 | "Full log" | ||
204 | ], | ||
194 | "default": "off", | 205 | "default": "off", |
195 | "description": "Trace requests to the ra_lsp_server" | 206 | "description": "Trace requests to the ra_lsp_server" |
207 | }, | ||
208 | "rust-analyzer.trace.cargo-watch": { | ||
209 | "type": "string", | ||
210 | "scope": "window", | ||
211 | "enum": [ | ||
212 | "off", | ||
213 | "error", | ||
214 | "verbose" | ||
215 | ], | ||
216 | "default": "off", | ||
217 | "description": "Trace output of cargo-watch" | ||
196 | } | 218 | } |
197 | } | 219 | } |
198 | }, | 220 | }, |
@@ -223,18 +245,6 @@ | |||
223 | "${workspaceRoot}" | 245 | "${workspaceRoot}" |
224 | ], | 246 | ], |
225 | "pattern": "$rustc" | 247 | "pattern": "$rustc" |
226 | }, | ||
227 | { | ||
228 | "name": "rustc-watch", | ||
229 | "fileLocation": [ | ||
230 | "relative", | ||
231 | "${workspaceRoot}" | ||
232 | ], | ||
233 | "background": { | ||
234 | "beginsPattern": "^\\[Running\\b", | ||
235 | "endsPattern": "^\\[Finished running\\b" | ||
236 | }, | ||
237 | "pattern": "$rustc" | ||
238 | } | 248 | } |
239 | ] | 249 | ] |
240 | } | 250 | } |