aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorSeivan Heidari <[email protected]>2019-12-23 14:35:31 +0000
committerSeivan Heidari <[email protected]>2019-12-23 14:35:31 +0000
commitb21d9337d9200e2cfdc90b386591c72c302dc03e (patch)
treef81f5c08f821115cee26fa4d3ceaae88c7807fd5 /editors
parent18a0937585b836ec5ed054b9ae48e0156ab6d9ef (diff)
parentce07a2daa9e53aa86a769f8641b14c2878444fbc (diff)
Merge branch 'master' into feature/themes
Diffstat (limited to 'editors')
-rw-r--r--editors/code/package-lock.json731
-rw-r--r--editors/code/package.json141
-rw-r--r--editors/code/rollup.config.js3
-rw-r--r--editors/code/src/commands/analyzer_status.ts14
-rw-r--r--editors/code/src/commands/apply_source_change.ts8
-rw-r--r--editors/code/src/commands/cargo_watch.ts49
-rw-r--r--editors/code/src/commands/expand_macro.ts10
-rw-r--r--editors/code/src/commands/index.ts2
-rw-r--r--editors/code/src/commands/inlay_hints.ts34
-rw-r--r--editors/code/src/commands/join_lines.ts6
-rw-r--r--editors/code/src/commands/matching_brace.ts6
-rw-r--r--editors/code/src/commands/on_enter.ts8
-rw-r--r--editors/code/src/commands/parent_module.ts6
-rw-r--r--editors/code/src/commands/runnables.ts52
-rw-r--r--editors/code/src/commands/syntaxTree.ts10
-rw-r--r--editors/code/src/commands/watch_status.ts2
-rw-r--r--editors/code/src/config.ts113
-rw-r--r--editors/code/src/events/change_active_text_editor.ts6
-rw-r--r--editors/code/src/events/change_text_document.ts2
-rw-r--r--editors/code/src/extension.ts73
-rw-r--r--editors/code/src/highlighting.ts30
-rw-r--r--editors/code/src/notifications/publish_decorations.ts11
-rw-r--r--editors/code/src/server.ts39
-rw-r--r--editors/code/src/test/fixtures/rust-diagnostics/error/E0277.json261
-rw-r--r--editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts29
-rw-r--r--editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts26
-rw-r--r--editors/code/src/test/utils/diagnotics/rust.test.ts92
-rw-r--r--editors/code/src/test/utils/diagnotics/vscode.test.ts24
-rw-r--r--editors/code/src/test/utils/index.ts2
-rw-r--r--editors/code/src/utils/diagnostics/SuggestedFix.ts4
-rw-r--r--editors/code/src/utils/diagnostics/SuggestedFixCollection.ts6
-rw-r--r--editors/code/src/utils/diagnostics/rust.ts58
-rw-r--r--editors/code/src/utils/diagnostics/vscode.ts2
-rw-r--r--editors/code/src/utils/processes.ts4
-rw-r--r--editors/code/tsconfig.json9
-rw-r--r--editors/code/tslint.json12
36 files changed, 1186 insertions, 699 deletions
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json
index a41497a23..4c5c13646 100644
--- a/editors/code/package-lock.json
+++ b/editors/code/package-lock.json
@@ -60,9 +60,9 @@
60 "dev": true 60 "dev": true
61 }, 61 },
62 "@types/node": { 62 "@types/node": {
63 "version": "10.14.13", 63 "version": "12.12.21",
64 "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.13.tgz", 64 "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.21.tgz",
65 "integrity": "sha512-yN/FNNW1UYsRR1wwAoyOwqvDuLDtVXnaJTZ898XIw/Q5cCaeVAlVwvsmXLX5PuiScBYwZsZU4JYSHB3TvfdwvQ==", 65 "integrity": "sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA==",
66 "dev": true 66 "dev": true
67 }, 67 },
68 "@types/resolve": { 68 "@types/resolve": {
@@ -81,9 +81,9 @@
81 "dev": true 81 "dev": true
82 }, 82 },
83 "@types/vscode": { 83 "@types/vscode": {
84 "version": "1.37.0", 84 "version": "1.41.0",
85 "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.37.0.tgz", 85 "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.41.0.tgz",
86 "integrity": "sha512-PRfeuqYuzk3vjf+puzxltIUWC+AhEGYpFX29/37w30DQSQnpf5AgMVf7GDBAdmTbWTBou+EMFz/Ne6XCM/KxzQ==", 86 "integrity": "sha512-7SfeY5u9jgiELwxyLB3z7l6l/GbN9CqpCQGkcRlB7tKRFBxzbz2PoBfGrLxI1vRfUCIq5+hg5vtDHExwq5j3+A==",
87 "dev": true 87 "dev": true
88 }, 88 },
89 "acorn": { 89 "acorn": {
@@ -131,6 +131,12 @@
131 "sprintf-js": "~1.0.2" 131 "sprintf-js": "~1.0.2"
132 } 132 }
133 }, 133 },
134 "atob": {
135 "version": "2.1.2",
136 "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
137 "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
138 "dev": true
139 },
134 "azure-devops-node-api": { 140 "azure-devops-node-api": {
135 "version": "7.2.0", 141 "version": "7.2.0",
136 "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-7.2.0.tgz", 142 "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-7.2.0.tgz",
@@ -198,6 +204,17 @@
198 "ansi-styles": "^3.2.1", 204 "ansi-styles": "^3.2.1",
199 "escape-string-regexp": "^1.0.5", 205 "escape-string-regexp": "^1.0.5",
200 "supports-color": "^5.3.0" 206 "supports-color": "^5.3.0"
207 },
208 "dependencies": {
209 "supports-color": {
210 "version": "5.5.0",
211 "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
212 "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
213 "dev": true,
214 "requires": {
215 "has-flag": "^3.0.0"
216 }
217 }
201 } 218 }
202 }, 219 },
203 "cheerio": { 220 "cheerio": {
@@ -215,22 +232,44 @@
215 } 232 }
216 }, 233 },
217 "cliui": { 234 "cliui": {
218 "version": "4.1.0", 235 "version": "5.0.0",
219 "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", 236 "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
220 "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", 237 "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
221 "dev": true, 238 "dev": true,
222 "requires": { 239 "requires": {
223 "string-width": "^2.1.1", 240 "string-width": "^3.1.0",
224 "strip-ansi": "^4.0.0", 241 "strip-ansi": "^5.2.0",
225 "wrap-ansi": "^2.0.0" 242 "wrap-ansi": "^5.1.0"
243 },
244 "dependencies": {
245 "ansi-regex": {
246 "version": "4.1.0",
247 "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
248 "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
249 "dev": true
250 },
251 "string-width": {
252 "version": "3.1.0",
253 "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
254 "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
255 "dev": true,
256 "requires": {
257 "emoji-regex": "^7.0.1",
258 "is-fullwidth-code-point": "^2.0.0",
259 "strip-ansi": "^5.1.0"
260 }
261 },
262 "strip-ansi": {
263 "version": "5.2.0",
264 "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
265 "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
266 "dev": true,
267 "requires": {
268 "ansi-regex": "^4.1.0"
269 }
270 }
226 } 271 }
227 }, 272 },
228 "code-point-at": {
229 "version": "1.1.0",
230 "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
231 "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
232 "dev": true
233 },
234 "color-convert": { 273 "color-convert": {
235 "version": "1.9.3", 274 "version": "1.9.3",
236 "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 275 "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
@@ -247,9 +286,9 @@
247 "dev": true 286 "dev": true
248 }, 287 },
249 "commander": { 288 "commander": {
250 "version": "2.20.0", 289 "version": "2.20.3",
251 "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", 290 "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
252 "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", 291 "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
253 "dev": true 292 "dev": true
254 }, 293 },
255 "concat-map": { 294 "concat-map": {
@@ -258,19 +297,6 @@
258 "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 297 "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
259 "dev": true 298 "dev": true
260 }, 299 },
261 "cross-spawn": {
262 "version": "6.0.5",
263 "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
264 "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
265 "dev": true,
266 "requires": {
267 "nice-try": "^1.0.4",
268 "path-key": "^2.0.1",
269 "semver": "^5.5.0",
270 "shebang-command": "^1.2.0",
271 "which": "^1.2.9"
272 }
273 },
274 "css-select": { 300 "css-select": {
275 "version": "1.2.0", 301 "version": "1.2.0",
276 "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", 302 "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz",
@@ -290,12 +316,12 @@
290 "dev": true 316 "dev": true
291 }, 317 },
292 "debug": { 318 "debug": {
293 "version": "3.1.0", 319 "version": "3.2.6",
294 "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 320 "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
295 "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 321 "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
296 "dev": true, 322 "dev": true,
297 "requires": { 323 "requires": {
298 "ms": "2.0.0" 324 "ms": "^2.1.1"
299 } 325 }
300 }, 326 },
301 "decamelize": { 327 "decamelize": {
@@ -304,6 +330,12 @@
304 "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", 330 "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
305 "dev": true 331 "dev": true
306 }, 332 },
333 "decode-uri-component": {
334 "version": "0.2.0",
335 "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
336 "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
337 "dev": true
338 },
307 "define-properties": { 339 "define-properties": {
308 "version": "1.1.3", 340 "version": "1.1.3",
309 "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", 341 "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
@@ -372,15 +404,6 @@
372 "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", 404 "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
373 "dev": true 405 "dev": true
374 }, 406 },
375 "end-of-stream": {
376 "version": "1.4.1",
377 "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
378 "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
379 "dev": true,
380 "requires": {
381 "once": "^1.4.0"
382 }
383 },
384 "entities": { 407 "entities": {
385 "version": "1.1.2", 408 "version": "1.1.2",
386 "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", 409 "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
@@ -388,23 +411,27 @@
388 "dev": true 411 "dev": true
389 }, 412 },
390 "es-abstract": { 413 "es-abstract": {
391 "version": "1.13.0", 414 "version": "1.16.3",
392 "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", 415 "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.3.tgz",
393 "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", 416 "integrity": "sha512-WtY7Fx5LiOnSYgF5eg/1T+GONaGmpvpPdCpSnYij+U2gDTL0UPfWrhDw7b2IYb+9NQJsYpCA0wOQvZfsd6YwRw==",
394 "dev": true, 417 "dev": true,
395 "requires": { 418 "requires": {
396 "es-to-primitive": "^1.2.0", 419 "es-to-primitive": "^1.2.1",
397 "function-bind": "^1.1.1", 420 "function-bind": "^1.1.1",
398 "has": "^1.0.3", 421 "has": "^1.0.3",
422 "has-symbols": "^1.0.1",
399 "is-callable": "^1.1.4", 423 "is-callable": "^1.1.4",
400 "is-regex": "^1.0.4", 424 "is-regex": "^1.0.4",
401 "object-keys": "^1.0.12" 425 "object-inspect": "^1.7.0",
426 "object-keys": "^1.1.1",
427 "string.prototype.trimleft": "^2.1.0",
428 "string.prototype.trimright": "^2.1.0"
402 } 429 }
403 }, 430 },
404 "es-to-primitive": { 431 "es-to-primitive": {
405 "version": "1.2.0", 432 "version": "1.2.1",
406 "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", 433 "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
407 "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", 434 "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
408 "dev": true, 435 "dev": true,
409 "requires": { 436 "requires": {
410 "is-callable": "^1.1.4", 437 "is-callable": "^1.1.4",
@@ -439,6 +466,16 @@
439 "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 466 "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
440 "dev": true 467 "dev": true
441 }, 468 },
469 "eslint-plugin-prettier": {
470 "version": "2.7.0",
471 "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.7.0.tgz",
472 "integrity": "sha512-CStQYJgALoQBw3FsBzH0VOVDRnJ/ZimUlpLm226U8qgqYJfPOY/CPK6wyRInMxh73HSKg5wyRwdS4BVYYHwokA==",
473 "dev": true,
474 "requires": {
475 "fast-diff": "^1.1.1",
476 "jest-docblock": "^21.0.0"
477 }
478 },
442 "esprima": { 479 "esprima": {
443 "version": "4.0.1", 480 "version": "4.0.1",
444 "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 481 "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
@@ -452,25 +489,16 @@
452 "dev": true 489 "dev": true
453 }, 490 },
454 "esutils": { 491 "esutils": {
455 "version": "2.0.2", 492 "version": "2.0.3",
456 "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", 493 "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
457 "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", 494 "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
458 "dev": true 495 "dev": true
459 }, 496 },
460 "execa": { 497 "fast-diff": {
461 "version": "1.0.0", 498 "version": "1.2.0",
462 "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", 499 "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
463 "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", 500 "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
464 "dev": true, 501 "dev": true
465 "requires": {
466 "cross-spawn": "^6.0.0",
467 "get-stream": "^4.0.0",
468 "is-stream": "^1.1.0",
469 "npm-run-path": "^2.0.0",
470 "p-finally": "^1.0.0",
471 "signal-exit": "^3.0.0",
472 "strip-eof": "^1.0.0"
473 }
474 }, 502 },
475 "fd-slicer": { 503 "fd-slicer": {
476 "version": "1.1.0", 504 "version": "1.1.0",
@@ -517,19 +545,10 @@
517 "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", 545 "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
518 "dev": true 546 "dev": true
519 }, 547 },
520 "get-stream": {
521 "version": "4.1.0",
522 "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
523 "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
524 "dev": true,
525 "requires": {
526 "pump": "^3.0.0"
527 }
528 },
529 "glob": { 548 "glob": {
530 "version": "7.1.4", 549 "version": "7.1.6",
531 "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", 550 "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
532 "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", 551 "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
533 "dev": true, 552 "dev": true,
534 "requires": { 553 "requires": {
535 "fs.realpath": "^1.0.0", 554 "fs.realpath": "^1.0.0",
@@ -562,9 +581,9 @@
562 "dev": true 581 "dev": true
563 }, 582 },
564 "has-symbols": { 583 "has-symbols": {
565 "version": "1.0.0", 584 "version": "1.0.1",
566 "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", 585 "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
567 "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", 586 "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==",
568 "dev": true 587 "dev": true
569 }, 588 },
570 "he": { 589 "he": {
@@ -595,12 +614,29 @@
595 "requires": { 614 "requires": {
596 "agent-base": "4", 615 "agent-base": "4",
597 "debug": "3.1.0" 616 "debug": "3.1.0"
617 },
618 "dependencies": {
619 "debug": {
620 "version": "3.1.0",
621 "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
622 "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
623 "dev": true,
624 "requires": {
625 "ms": "2.0.0"
626 }
627 },
628 "ms": {
629 "version": "2.0.0",
630 "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
631 "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
632 "dev": true
633 }
598 } 634 }
599 }, 635 },
600 "https-proxy-agent": { 636 "https-proxy-agent": {
601 "version": "2.2.3", 637 "version": "2.2.4",
602 "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.3.tgz", 638 "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz",
603 "integrity": "sha512-Ytgnz23gm2DVftnzqRRz2dOXZbGd2uiajSw/95bPp6v53zPRspQjLm/AfBgqbJ2qfeRXWIOMVLpp86+/5yX39Q==", 639 "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==",
604 "dev": true, 640 "dev": true,
605 "requires": { 641 "requires": {
606 "agent-base": "^4.3.0", 642 "agent-base": "^4.3.0",
@@ -618,9 +654,9 @@
618 } 654 }
619 }, 655 },
620 "inherits": { 656 "inherits": {
621 "version": "2.0.3", 657 "version": "2.0.4",
622 "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 658 "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
623 "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 659 "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
624 "dev": true 660 "dev": true
625 }, 661 },
626 "interpret": { 662 "interpret": {
@@ -629,16 +665,10 @@
629 "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", 665 "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==",
630 "dev": true 666 "dev": true
631 }, 667 },
632 "invert-kv": {
633 "version": "2.0.0",
634 "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
635 "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
636 "dev": true
637 },
638 "is-buffer": { 668 "is-buffer": {
639 "version": "2.0.3", 669 "version": "2.0.4",
640 "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", 670 "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz",
641 "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", 671 "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==",
642 "dev": true 672 "dev": true
643 }, 673 },
644 "is-callable": { 674 "is-callable": {
@@ -683,19 +713,13 @@
683 "has": "^1.0.1" 713 "has": "^1.0.1"
684 } 714 }
685 }, 715 },
686 "is-stream": {
687 "version": "1.1.0",
688 "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
689 "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
690 "dev": true
691 },
692 "is-symbol": { 716 "is-symbol": {
693 "version": "1.0.2", 717 "version": "1.0.3",
694 "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", 718 "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
695 "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", 719 "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
696 "dev": true, 720 "dev": true,
697 "requires": { 721 "requires": {
698 "has-symbols": "^1.0.0" 722 "has-symbols": "^1.0.1"
699 } 723 }
700 }, 724 },
701 "isexe": { 725 "isexe": {
@@ -704,6 +728,12 @@
704 "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 728 "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
705 "dev": true 729 "dev": true
706 }, 730 },
731 "jest-docblock": {
732 "version": "21.2.0",
733 "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-21.2.0.tgz",
734 "integrity": "sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw==",
735 "dev": true
736 },
707 "js-tokens": { 737 "js-tokens": {
708 "version": "4.0.0", 738 "version": "4.0.0",
709 "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 739 "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -720,19 +750,11 @@
720 "esprima": "^4.0.0" 750 "esprima": "^4.0.0"
721 } 751 }
722 }, 752 },
723 "jsonc-parser": { 753 "lines-and-columns": {
724 "version": "2.2.0", 754 "version": "1.1.6",
725 "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.2.0.tgz", 755 "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
726 "integrity": "sha512-4fLQxW1j/5fWj6p78vAlAafoCKtuBm6ghv+Ij5W2DrDx0qE+ZdEl2c6Ko1mgJNF5ftX1iEWQQ4Ap7+3GlhjkOA==" 756 "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=",
727 }, 757 "dev": true
728 "lcid": {
729 "version": "2.0.0",
730 "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
731 "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
732 "dev": true,
733 "requires": {
734 "invert-kv": "^2.0.0"
735 }
736 }, 758 },
737 "linkify-it": { 759 "linkify-it": {
738 "version": "2.2.0", 760 "version": "2.2.0",
@@ -768,6 +790,11 @@
768 "chalk": "^2.0.1" 790 "chalk": "^2.0.1"
769 } 791 }
770 }, 792 },
793 "lookpath": {
794 "version": "1.0.4",
795 "resolved": "https://registry.npmjs.org/lookpath/-/lookpath-1.0.4.tgz",
796 "integrity": "sha512-xVFrWlfo7n8VZs1YjBWKkbSIJU7DKE/0Mep62KeT94V1Ui1IY9w5fXfgiCsDIDZkakIYSXSeaW2FLbCqfw9/Cw=="
797 },
771 "magic-string": { 798 "magic-string": {
772 "version": "0.25.3", 799 "version": "0.25.3",
773 "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.3.tgz", 800 "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.3.tgz",
@@ -777,15 +804,6 @@
777 "sourcemap-codec": "^1.4.4" 804 "sourcemap-codec": "^1.4.4"
778 } 805 }
779 }, 806 },
780 "map-age-cleaner": {
781 "version": "0.1.3",
782 "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
783 "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
784 "dev": true,
785 "requires": {
786 "p-defer": "^1.0.0"
787 }
788 },
789 "markdown-it": { 807 "markdown-it": {
790 "version": "8.4.2", 808 "version": "8.4.2",
791 "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", 809 "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz",
@@ -805,29 +823,12 @@
805 "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", 823 "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=",
806 "dev": true 824 "dev": true
807 }, 825 },
808 "mem": {
809 "version": "4.3.0",
810 "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz",
811 "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
812 "dev": true,
813 "requires": {
814 "map-age-cleaner": "^0.1.1",
815 "mimic-fn": "^2.0.0",
816 "p-is-promise": "^2.0.0"
817 }
818 },
819 "mime": { 826 "mime": {
820 "version": "1.6.0", 827 "version": "1.6.0",
821 "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 828 "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
822 "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 829 "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
823 "dev": true 830 "dev": true
824 }, 831 },
825 "mimic-fn": {
826 "version": "2.1.0",
827 "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
828 "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
829 "dev": true
830 },
831 "minimatch": { 832 "minimatch": {
832 "version": "3.0.4", 833 "version": "3.0.4",
833 "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 834 "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@@ -853,9 +854,9 @@
853 } 854 }
854 }, 855 },
855 "mocha": { 856 "mocha": {
856 "version": "6.2.0", 857 "version": "6.2.2",
857 "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", 858 "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.2.tgz",
858 "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", 859 "integrity": "sha512-FgDS9Re79yU1xz5d+C4rv1G7QagNGHZ+iXF81hO8zY35YZZcLEsJVfFolfsqKFWunATEvNzMK0r/CwWd/szO9A==",
859 "dev": true, 860 "dev": true,
860 "requires": { 861 "requires": {
861 "ansi-colors": "3.2.3", 862 "ansi-colors": "3.2.3",
@@ -878,20 +879,11 @@
878 "supports-color": "6.0.0", 879 "supports-color": "6.0.0",
879 "which": "1.3.1", 880 "which": "1.3.1",
880 "wide-align": "1.1.3", 881 "wide-align": "1.1.3",
881 "yargs": "13.2.2", 882 "yargs": "13.3.0",
882 "yargs-parser": "13.0.0", 883 "yargs-parser": "13.1.1",
883 "yargs-unparser": "1.5.0" 884 "yargs-unparser": "1.6.0"
884 }, 885 },
885 "dependencies": { 886 "dependencies": {
886 "debug": {
887 "version": "3.2.6",
888 "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
889 "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
890 "dev": true,
891 "requires": {
892 "ms": "^2.1.1"
893 }
894 },
895 "glob": { 887 "glob": {
896 "version": "7.1.3", 888 "version": "7.1.3",
897 "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", 889 "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
@@ -905,28 +897,13 @@
905 "once": "^1.3.0", 897 "once": "^1.3.0",
906 "path-is-absolute": "^1.0.0" 898 "path-is-absolute": "^1.0.0"
907 } 899 }
908 },
909 "ms": {
910 "version": "2.1.1",
911 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
912 "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
913 "dev": true
914 },
915 "supports-color": {
916 "version": "6.0.0",
917 "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz",
918 "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==",
919 "dev": true,
920 "requires": {
921 "has-flag": "^3.0.0"
922 }
923 } 900 }
924 } 901 }
925 }, 902 },
926 "ms": { 903 "ms": {
927 "version": "2.0.0", 904 "version": "2.1.1",
928 "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 905 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
929 "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", 906 "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
930 "dev": true 907 "dev": true
931 }, 908 },
932 "mute-stream": { 909 "mute-stream": {
@@ -935,12 +912,6 @@
935 "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", 912 "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
936 "dev": true 913 "dev": true
937 }, 914 },
938 "nice-try": {
939 "version": "1.0.5",
940 "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
941 "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
942 "dev": true
943 },
944 "node-environment-flags": { 915 "node-environment-flags": {
945 "version": "1.0.5", 916 "version": "1.0.5",
946 "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", 917 "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz",
@@ -951,15 +922,6 @@
951 "semver": "^5.7.0" 922 "semver": "^5.7.0"
952 } 923 }
953 }, 924 },
954 "npm-run-path": {
955 "version": "2.0.2",
956 "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
957 "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
958 "dev": true,
959 "requires": {
960 "path-key": "^2.0.0"
961 }
962 },
963 "nth-check": { 925 "nth-check": {
964 "version": "1.0.2", 926 "version": "1.0.2",
965 "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", 927 "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz",
@@ -969,10 +931,10 @@
969 "boolbase": "~1.0.0" 931 "boolbase": "~1.0.0"
970 } 932 }
971 }, 933 },
972 "number-is-nan": { 934 "object-inspect": {
973 "version": "1.0.1", 935 "version": "1.7.0",
974 "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 936 "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz",
975 "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", 937 "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==",
976 "dev": true 938 "dev": true
977 }, 939 },
978 "object-keys": { 940 "object-keys": {
@@ -1024,17 +986,6 @@
1024 "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", 986 "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
1025 "dev": true 987 "dev": true
1026 }, 988 },
1027 "os-locale": {
1028 "version": "3.1.0",
1029 "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
1030 "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
1031 "dev": true,
1032 "requires": {
1033 "execa": "^1.0.0",
1034 "lcid": "^2.0.0",
1035 "mem": "^4.0.0"
1036 }
1037 },
1038 "os-tmpdir": { 989 "os-tmpdir": {
1039 "version": "1.0.2", 990 "version": "1.0.2",
1040 "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 991 "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
@@ -1051,24 +1002,6 @@
1051 "os-tmpdir": "^1.0.0" 1002 "os-tmpdir": "^1.0.0"
1052 } 1003 }
1053 }, 1004 },
1054 "p-defer": {
1055 "version": "1.0.0",
1056 "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
1057 "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
1058 "dev": true
1059 },
1060 "p-finally": {
1061 "version": "1.0.0",
1062 "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
1063 "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
1064 "dev": true
1065 },
1066 "p-is-promise": {
1067 "version": "2.1.0",
1068 "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz",
1069 "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==",
1070 "dev": true
1071 },
1072 "p-limit": { 1005 "p-limit": {
1073 "version": "2.2.1", 1006 "version": "2.2.1",
1074 "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", 1007 "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz",
@@ -1123,12 +1056,6 @@
1123 "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 1056 "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
1124 "dev": true 1057 "dev": true
1125 }, 1058 },
1126 "path-key": {
1127 "version": "2.0.1",
1128 "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
1129 "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
1130 "dev": true
1131 },
1132 "path-parse": { 1059 "path-parse": {
1133 "version": "1.0.6", 1060 "version": "1.0.6",
1134 "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 1061 "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
@@ -1142,21 +1069,11 @@
1142 "dev": true 1069 "dev": true
1143 }, 1070 },
1144 "prettier": { 1071 "prettier": {
1145 "version": "1.18.2", 1072 "version": "1.19.1",
1146 "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", 1073 "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
1147 "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", 1074 "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
1148 "dev": true 1075 "dev": true
1149 }, 1076 },
1150 "pump": {
1151 "version": "3.0.0",
1152 "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
1153 "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
1154 "dev": true,
1155 "requires": {
1156 "end-of-stream": "^1.1.0",
1157 "once": "^1.3.1"
1158 }
1159 },
1160 "read": { 1077 "read": {
1161 "version": "1.0.7", 1078 "version": "1.0.7",
1162 "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", 1079 "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz",
@@ -1207,6 +1124,12 @@
1207 "path-parse": "^1.0.6" 1124 "path-parse": "^1.0.6"
1208 } 1125 }
1209 }, 1126 },
1127 "resolve-url": {
1128 "version": "0.2.1",
1129 "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
1130 "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
1131 "dev": true
1132 },
1210 "rimraf": { 1133 "rimraf": {
1211 "version": "2.7.1", 1134 "version": "2.7.1",
1212 "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", 1135 "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
@@ -1217,9 +1140,9 @@
1217 } 1140 }
1218 }, 1141 },
1219 "rollup": { 1142 "rollup": {
1220 "version": "1.23.1", 1143 "version": "1.27.13",
1221 "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.23.1.tgz", 1144 "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.13.tgz",
1222 "integrity": "sha512-95C1GZQpr/NIA0kMUQmSjuMDQ45oZfPgDBcN0yZwBG7Kee//m7H68vgIyg+SPuyrTZ5PrXfyLK80OzXeKG5dAA==", 1145 "integrity": "sha512-hDi7M07MpmNSDE8YVwGVFA8L7n8jTLJ4lG65nMAijAyqBe//rtu4JdxjUBE7JqXfdpqxqDTbCDys9WcqdpsQvw==",
1223 "dev": true, 1146 "dev": true,
1224 "requires": { 1147 "requires": {
1225 "@types/estree": "*", 1148 "@types/estree": "*",
@@ -1281,6 +1204,16 @@
1281 } 1204 }
1282 } 1205 }
1283 }, 1206 },
1207 "rollup-plugin-sourcemaps": {
1208 "version": "0.4.2",
1209 "resolved": "https://registry.npmjs.org/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.4.2.tgz",
1210 "integrity": "sha1-YhJaqUCHqt97g+9N+vYptHMTXoc=",
1211 "dev": true,
1212 "requires": {
1213 "rollup-pluginutils": "^2.0.1",
1214 "source-map-resolve": "^0.5.0"
1215 }
1216 },
1284 "rollup-plugin-typescript": { 1217 "rollup-plugin-typescript": {
1285 "version": "1.0.1", 1218 "version": "1.0.1",
1286 "resolved": "https://registry.npmjs.org/rollup-plugin-typescript/-/rollup-plugin-typescript-1.0.1.tgz", 1219 "resolved": "https://registry.npmjs.org/rollup-plugin-typescript/-/rollup-plugin-typescript-1.0.1.tgz",
@@ -1318,14 +1251,15 @@
1318 "dev": true 1251 "dev": true
1319 }, 1252 },
1320 "seedrandom": { 1253 "seedrandom": {
1321 "version": "3.0.1", 1254 "version": "3.0.5",
1322 "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.1.tgz", 1255 "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
1323 "integrity": "sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg==" 1256 "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg=="
1324 }, 1257 },
1325 "semver": { 1258 "semver": {
1326 "version": "5.7.0", 1259 "version": "5.7.1",
1327 "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", 1260 "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
1328 "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" 1261 "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
1262 "dev": true
1329 }, 1263 },
1330 "set-blocking": { 1264 "set-blocking": {
1331 "version": "2.0.0", 1265 "version": "2.0.0",
@@ -1333,21 +1267,6 @@
1333 "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", 1267 "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
1334 "dev": true 1268 "dev": true
1335 }, 1269 },
1336 "shebang-command": {
1337 "version": "1.2.0",
1338 "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
1339 "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
1340 "dev": true,
1341 "requires": {
1342 "shebang-regex": "^1.0.0"
1343 }
1344 },
1345 "shebang-regex": {
1346 "version": "1.0.0",
1347 "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
1348 "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
1349 "dev": true
1350 },
1351 "shelljs": { 1270 "shelljs": {
1352 "version": "0.8.3", 1271 "version": "0.8.3",
1353 "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", 1272 "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz",
@@ -1378,10 +1297,23 @@
1378 } 1297 }
1379 } 1298 }
1380 }, 1299 },
1381 "signal-exit": { 1300 "source-map-resolve": {
1382 "version": "3.0.2", 1301 "version": "0.5.2",
1383 "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 1302 "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz",
1384 "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", 1303 "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==",
1304 "dev": true,
1305 "requires": {
1306 "atob": "^2.1.1",
1307 "decode-uri-component": "^0.2.0",
1308 "resolve-url": "^0.2.1",
1309 "source-map-url": "^0.4.0",
1310 "urix": "^0.1.0"
1311 }
1312 },
1313 "source-map-url": {
1314 "version": "0.4.0",
1315 "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
1316 "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=",
1385 "dev": true 1317 "dev": true
1386 }, 1318 },
1387 "sourcemap-codec": { 1319 "sourcemap-codec": {
@@ -1406,6 +1338,26 @@
1406 "strip-ansi": "^4.0.0" 1338 "strip-ansi": "^4.0.0"
1407 } 1339 }
1408 }, 1340 },
1341 "string.prototype.trimleft": {
1342 "version": "2.1.0",
1343 "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz",
1344 "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==",
1345 "dev": true,
1346 "requires": {
1347 "define-properties": "^1.1.3",
1348 "function-bind": "^1.1.1"
1349 }
1350 },
1351 "string.prototype.trimright": {
1352 "version": "2.1.0",
1353 "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz",
1354 "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==",
1355 "dev": true,
1356 "requires": {
1357 "define-properties": "^1.1.3",
1358 "function-bind": "^1.1.1"
1359 }
1360 },
1409 "string_decoder": { 1361 "string_decoder": {
1410 "version": "1.3.0", 1362 "version": "1.3.0",
1411 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", 1363 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
@@ -1424,12 +1376,6 @@
1424 "ansi-regex": "^3.0.0" 1376 "ansi-regex": "^3.0.0"
1425 } 1377 }
1426 }, 1378 },
1427 "strip-eof": {
1428 "version": "1.0.0",
1429 "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
1430 "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
1431 "dev": true
1432 },
1433 "strip-json-comments": { 1379 "strip-json-comments": {
1434 "version": "2.0.1", 1380 "version": "2.0.1",
1435 "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 1381 "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
@@ -1437,9 +1383,9 @@
1437 "dev": true 1383 "dev": true
1438 }, 1384 },
1439 "supports-color": { 1385 "supports-color": {
1440 "version": "5.5.0", 1386 "version": "6.0.0",
1441 "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 1387 "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz",
1442 "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 1388 "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==",
1443 "dev": true, 1389 "dev": true,
1444 "requires": { 1390 "requires": {
1445 "has-flag": "^3.0.0" 1391 "has-flag": "^3.0.0"
@@ -1461,16 +1407,16 @@
1461 "dev": true 1407 "dev": true
1462 }, 1408 },
1463 "tslint": { 1409 "tslint": {
1464 "version": "5.18.0", 1410 "version": "5.20.1",
1465 "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", 1411 "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz",
1466 "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", 1412 "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==",
1467 "dev": true, 1413 "dev": true,
1468 "requires": { 1414 "requires": {
1469 "@babel/code-frame": "^7.0.0", 1415 "@babel/code-frame": "^7.0.0",
1470 "builtin-modules": "^1.1.1", 1416 "builtin-modules": "^1.1.1",
1471 "chalk": "^2.3.0", 1417 "chalk": "^2.3.0",
1472 "commander": "^2.12.1", 1418 "commander": "^2.12.1",
1473 "diff": "^3.2.0", 1419 "diff": "^4.0.1",
1474 "glob": "^7.1.1", 1420 "glob": "^7.1.1",
1475 "js-yaml": "^3.13.1", 1421 "js-yaml": "^3.13.1",
1476 "minimatch": "^3.0.4", 1422 "minimatch": "^3.0.4",
@@ -1479,6 +1425,14 @@
1479 "semver": "^5.3.0", 1425 "semver": "^5.3.0",
1480 "tslib": "^1.8.0", 1426 "tslib": "^1.8.0",
1481 "tsutils": "^2.29.0" 1427 "tsutils": "^2.29.0"
1428 },
1429 "dependencies": {
1430 "diff": {
1431 "version": "4.0.1",
1432 "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
1433 "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
1434 "dev": true
1435 }
1482 } 1436 }
1483 }, 1437 },
1484 "tslint-config-prettier": { 1438 "tslint-config-prettier": {
@@ -1487,6 +1441,17 @@
1487 "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==", 1441 "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==",
1488 "dev": true 1442 "dev": true
1489 }, 1443 },
1444 "tslint-plugin-prettier": {
1445 "version": "2.0.1",
1446 "resolved": "https://registry.npmjs.org/tslint-plugin-prettier/-/tslint-plugin-prettier-2.0.1.tgz",
1447 "integrity": "sha512-4FX9JIx/1rKHIPJNfMb+ooX1gPk5Vg3vNi7+dyFYpLO+O57F4g+b/fo1+W/G0SUOkBLHB/YKScxjX/P+7ZT/Tw==",
1448 "dev": true,
1449 "requires": {
1450 "eslint-plugin-prettier": "^2.2.0",
1451 "lines-and-columns": "^1.1.6",
1452 "tslib": "^1.7.1"
1453 }
1454 },
1490 "tsutils": { 1455 "tsutils": {
1491 "version": "2.29.0", 1456 "version": "2.29.0",
1492 "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", 1457 "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
@@ -1513,9 +1478,9 @@
1513 } 1478 }
1514 }, 1479 },
1515 "typescript": { 1480 "typescript": {
1516 "version": "3.5.3", 1481 "version": "3.7.3",
1517 "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", 1482 "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz",
1518 "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", 1483 "integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==",
1519 "dev": true 1484 "dev": true
1520 }, 1485 },
1521 "uc.micro": { 1486 "uc.micro": {
@@ -1530,6 +1495,12 @@
1530 "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", 1495 "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=",
1531 "dev": true 1496 "dev": true
1532 }, 1497 },
1498 "urix": {
1499 "version": "0.1.0",
1500 "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
1501 "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
1502 "dev": true
1503 },
1533 "url-join": { 1504 "url-join": {
1534 "version": "1.1.0", 1505 "version": "1.1.0",
1535 "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", 1506 "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz",
@@ -1543,9 +1514,9 @@
1543 "dev": true 1514 "dev": true
1544 }, 1515 },
1545 "vsce": { 1516 "vsce": {
1546 "version": "1.67.1", 1517 "version": "1.71.0",
1547 "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.67.1.tgz", 1518 "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.71.0.tgz",
1548 "integrity": "sha512-Y/0fnfaLs2cCfytTGmy4Cp1bf9BaxHO7020YePdUwxjAlPlZ9+lm74M9yEFEWXTIug0L0sMax1WMz0TnozIqxg==", 1519 "integrity": "sha512-7k+LPC4oJYPyyxs0a5nh4A8CleQ6+2EMPiAiX/bDyN+PmwJFm2FFPqLRxdIsIWfFnkW4ZMQBf10+W62dCRd9kQ==",
1549 "dev": true, 1520 "dev": true,
1550 "requires": { 1521 "requires": {
1551 "azure-devops-node-api": "^7.2.0", 1522 "azure-devops-node-api": "^7.2.0",
@@ -1571,41 +1542,48 @@
1571 } 1542 }
1572 }, 1543 },
1573 "vscode-jsonrpc": { 1544 "vscode-jsonrpc": {
1574 "version": "4.1.0-next.3", 1545 "version": "5.0.0-next.5",
1575 "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.1.0-next.3.tgz", 1546 "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-5.0.0-next.5.tgz",
1576 "integrity": "sha512-Z6oxBiMks2+UADV1QHXVooSakjyhI+eHTnXzDyVvVMmegvSfkXk2w6mPEdSkaNHFBdtWW7n20H1yw2nA3A17mg==" 1547 "integrity": "sha512-k9akfglxWgr0dtLNscq2uBq48XJwnhf4EaDxn05KQowRwR0DkNML0zeYqFRLtXZe6x5vpL5ppyu4o6GqL+23YQ=="
1577 }, 1548 },
1578 "vscode-languageclient": { 1549 "vscode-languageclient": {
1579 "version": "5.3.0-next.4", 1550 "version": "6.0.0-next.9",
1580 "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-5.3.0-next.4.tgz", 1551 "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-6.0.0-next.9.tgz",
1581 "integrity": "sha512-RODuzXErVpJRSgHv+Xei8fwQtZ/iZOWPCqlLl07NTtkzgTAepJf9r4EioZVuTviGJ5DEJ9xs0bjrit8shKtW6Q==", 1552 "integrity": "sha512-NEpeeFM9FKrrRqlBHXGfwpkhtnjruDz3zfFBP+Cymr10qigAEtE/JsODJsIG/ErGqjh3/JXxu8SUOVTGu5oK+w==",
1582 "requires": { 1553 "requires": {
1583 "semver": "^5.5.0", 1554 "semver": "^6.3.0",
1584 "vscode-languageserver-protocol": "3.15.0-next.4" 1555 "vscode-languageserver-protocol": "^3.15.0-next.14"
1556 },
1557 "dependencies": {
1558 "semver": {
1559 "version": "6.3.0",
1560 "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
1561 "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
1562 }
1585 } 1563 }
1586 }, 1564 },
1587 "vscode-languageserver-protocol": { 1565 "vscode-languageserver-protocol": {
1588 "version": "3.15.0-next.4", 1566 "version": "3.15.0-next.14",
1589 "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.4.tgz", 1567 "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.14.tgz",
1590 "integrity": "sha512-4AgisQ8GWa3irdRu3/UNr3brcSSm0oobmoV1eSOnV7JM32lYyXDnSKB7RuTTXvaAjD/0xQJLEGhkyGHS5gbywA==", 1568 "integrity": "sha512-xUwwno6Q6RFd2Z2EWV9D3dQlsKPnHyiZMNWq+EC7JJdp2WH1gRlD+KPX4UGRCnJK0WI5omqHV313IESPwRY5xA==",
1591 "requires": { 1569 "requires": {
1592 "vscode-jsonrpc": "^4.1.0-next.1", 1570 "vscode-jsonrpc": "^5.0.0-next.5",
1593 "vscode-languageserver-types": "3.15.0-next.1" 1571 "vscode-languageserver-types": "^3.15.0-next.9"
1594 } 1572 }
1595 }, 1573 },
1596 "vscode-languageserver-types": { 1574 "vscode-languageserver-types": {
1597 "version": "3.15.0-next.1", 1575 "version": "3.15.0-next.9",
1598 "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0-next.1.tgz", 1576 "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0-next.9.tgz",
1599 "integrity": "sha512-R0kzmaI8gOGEoU7b9huYQAzgZzRQ/5Q8HKjsIUdfz0MjXcBZ4tr1ik1So1p1O5kGrI1VTCd22Fw/wI7ECGoIPw==" 1577 "integrity": "sha512-Rl/8qJ6932nrHCdPn+9y0x08uLVQaSLRG+U4JzhyKpWU4eJbVaDRoAcz1Llj7CErJGbPr6kdBvShPy5fRfR+Uw=="
1600 }, 1578 },
1601 "vscode-test": { 1579 "vscode-test": {
1602 "version": "1.2.0", 1580 "version": "1.3.0",
1603 "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-1.2.0.tgz", 1581 "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-1.3.0.tgz",
1604 "integrity": "sha512-aowqgc8gZe0eflzVUXsBjBrlsJ8eC35kfgfSEeHu9PKA1vQKm/3rVK43TlbxGue8hKtZBElNAJ5QuYklR/vLJA==", 1582 "integrity": "sha512-LddukcBiSU2FVTDr3c1D8lwkiOvwlJdDL2hqVbn6gIz+rpTqUCkMZSKYm94Y1v0WXlHSDQBsXyY+tchWQgGVsw==",
1605 "dev": true, 1583 "dev": true,
1606 "requires": { 1584 "requires": {
1607 "http-proxy-agent": "^2.1.0", 1585 "http-proxy-agent": "^2.1.0",
1608 "https-proxy-agent": "^2.2.1", 1586 "https-proxy-agent": "^2.2.4",
1609 "rimraf": "^2.6.3" 1587 "rimraf": "^2.6.3"
1610 } 1588 }
1611 }, 1589 },
@@ -1634,48 +1612,40 @@
1634 } 1612 }
1635 }, 1613 },
1636 "wrap-ansi": { 1614 "wrap-ansi": {
1637 "version": "2.1.0", 1615 "version": "5.1.0",
1638 "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", 1616 "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
1639 "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", 1617 "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
1640 "dev": true, 1618 "dev": true,
1641 "requires": { 1619 "requires": {
1642 "string-width": "^1.0.1", 1620 "ansi-styles": "^3.2.0",
1643 "strip-ansi": "^3.0.1" 1621 "string-width": "^3.0.0",
1622 "strip-ansi": "^5.0.0"
1644 }, 1623 },
1645 "dependencies": { 1624 "dependencies": {
1646 "ansi-regex": { 1625 "ansi-regex": {
1647 "version": "2.1.1", 1626 "version": "4.1.0",
1648 "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 1627 "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
1649 "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", 1628 "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
1650 "dev": true 1629 "dev": true
1651 }, 1630 },
1652 "is-fullwidth-code-point": {
1653 "version": "1.0.0",
1654 "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
1655 "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
1656 "dev": true,
1657 "requires": {
1658 "number-is-nan": "^1.0.0"
1659 }
1660 },
1661 "string-width": { 1631 "string-width": {
1662 "version": "1.0.2", 1632 "version": "3.1.0",
1663 "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 1633 "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
1664 "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 1634 "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
1665 "dev": true, 1635 "dev": true,
1666 "requires": { 1636 "requires": {
1667 "code-point-at": "^1.0.0", 1637 "emoji-regex": "^7.0.1",
1668 "is-fullwidth-code-point": "^1.0.0", 1638 "is-fullwidth-code-point": "^2.0.0",
1669 "strip-ansi": "^3.0.0" 1639 "strip-ansi": "^5.1.0"
1670 } 1640 }
1671 }, 1641 },
1672 "strip-ansi": { 1642 "strip-ansi": {
1673 "version": "3.0.1", 1643 "version": "5.2.0",
1674 "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 1644 "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
1675 "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 1645 "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
1676 "dev": true, 1646 "dev": true,
1677 "requires": { 1647 "requires": {
1678 "ansi-regex": "^2.0.0" 1648 "ansi-regex": "^4.1.0"
1679 } 1649 }
1680 } 1650 }
1681 } 1651 }
@@ -1693,22 +1663,21 @@
1693 "dev": true 1663 "dev": true
1694 }, 1664 },
1695 "yargs": { 1665 "yargs": {
1696 "version": "13.2.2", 1666 "version": "13.3.0",
1697 "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", 1667 "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz",
1698 "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", 1668 "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==",
1699 "dev": true, 1669 "dev": true,
1700 "requires": { 1670 "requires": {
1701 "cliui": "^4.0.0", 1671 "cliui": "^5.0.0",
1702 "find-up": "^3.0.0", 1672 "find-up": "^3.0.0",
1703 "get-caller-file": "^2.0.1", 1673 "get-caller-file": "^2.0.1",
1704 "os-locale": "^3.1.0",
1705 "require-directory": "^2.1.1", 1674 "require-directory": "^2.1.1",
1706 "require-main-filename": "^2.0.0", 1675 "require-main-filename": "^2.0.0",
1707 "set-blocking": "^2.0.0", 1676 "set-blocking": "^2.0.0",
1708 "string-width": "^3.0.0", 1677 "string-width": "^3.0.0",
1709 "which-module": "^2.0.0", 1678 "which-module": "^2.0.0",
1710 "y18n": "^4.0.0", 1679 "y18n": "^4.0.0",
1711 "yargs-parser": "^13.0.0" 1680 "yargs-parser": "^13.1.1"
1712 }, 1681 },
1713 "dependencies": { 1682 "dependencies": {
1714 "ansi-regex": { 1683 "ansi-regex": {
@@ -1740,9 +1709,9 @@
1740 } 1709 }
1741 }, 1710 },
1742 "yargs-parser": { 1711 "yargs-parser": {
1743 "version": "13.0.0", 1712 "version": "13.1.1",
1744 "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", 1713 "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
1745 "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", 1714 "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
1746 "dev": true, 1715 "dev": true,
1747 "requires": { 1716 "requires": {
1748 "camelcase": "^5.0.0", 1717 "camelcase": "^5.0.0",
@@ -1750,58 +1719,14 @@
1750 } 1719 }
1751 }, 1720 },
1752 "yargs-unparser": { 1721 "yargs-unparser": {
1753 "version": "1.5.0", 1722 "version": "1.6.0",
1754 "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", 1723 "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz",
1755 "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", 1724 "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==",
1756 "dev": true, 1725 "dev": true,
1757 "requires": { 1726 "requires": {
1758 "flat": "^4.1.0", 1727 "flat": "^4.1.0",
1759 "lodash": "^4.17.11", 1728 "lodash": "^4.17.15",
1760 "yargs": "^12.0.5" 1729 "yargs": "^13.3.0"
1761 },
1762 "dependencies": {
1763 "get-caller-file": {
1764 "version": "1.0.3",
1765 "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
1766 "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==",
1767 "dev": true
1768 },
1769 "require-main-filename": {
1770 "version": "1.0.1",
1771 "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
1772 "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
1773 "dev": true
1774 },
1775 "yargs": {
1776 "version": "12.0.5",
1777 "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz",
1778 "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==",
1779 "dev": true,
1780 "requires": {
1781 "cliui": "^4.0.0",
1782 "decamelize": "^1.2.0",
1783 "find-up": "^3.0.0",
1784 "get-caller-file": "^1.0.1",
1785 "os-locale": "^3.0.0",
1786 "require-directory": "^2.1.1",
1787 "require-main-filename": "^1.0.1",
1788 "set-blocking": "^2.0.0",
1789 "string-width": "^2.0.0",
1790 "which-module": "^2.0.0",
1791 "y18n": "^3.2.1 || ^4.0.0",
1792 "yargs-parser": "^11.1.1"
1793 }
1794 },
1795 "yargs-parser": {
1796 "version": "11.1.1",
1797 "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz",
1798 "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==",
1799 "dev": true,
1800 "requires": {
1801 "camelcase": "^5.0.0",
1802 "decamelize": "^1.2.0"
1803 }
1804 }
1805 } 1730 }
1806 }, 1731 },
1807 "yauzl": { 1732 "yauzl": {
diff --git a/editors/code/package.json b/editors/code/package.json
index e21dfa174..8e7046418 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -13,7 +13,7 @@
13 "Other" 13 "Other"
14 ], 14 ],
15 "engines": { 15 "engines": {
16 "vscode": "^1.37.0" 16 "vscode": "^1.41.0"
17 }, 17 },
18 "scripts": { 18 "scripts": {
19 "vscode:prepublish": "npm run compile", 19 "vscode:prepublish": "npm run compile",
@@ -27,33 +27,37 @@
27 "travis": "npm run compile && npm run test && npm run lint && npm run prettier -- --write && git diff --exit-code" 27 "travis": "npm run compile && npm run test && npm run lint && npm run prettier -- --write && git diff --exit-code"
28 }, 28 },
29 "prettier": { 29 "prettier": {
30 "singleQuote": true,
30 "tabWidth": 4, 31 "tabWidth": 4,
31 "singleQuote": true 32 "trailingComma": "all"
32 }, 33 },
33 "dependencies": { 34 "dependencies": {
34 "seedrandom": "^3.0.1", 35 "lookpath": "^1.0.4",
35 "vscode-languageclient": "^5.3.0-next.4", 36 "seedrandom": "^3.0.5",
37 "vscode-languageclient": "^6.0.0-next.9",
36 "jsonc-parser": "^2.1.0" 38 "jsonc-parser": "^2.1.0"
37 }, 39 },
38 "devDependencies": { 40 "devDependencies": {
39 "@types/glob": "^7.1.1", 41 "@types/glob": "^7.1.1",
40 "@types/mocha": "^5.2.7", 42 "@types/mocha": "^5.2.7",
41 "@types/node": "^10.14.13", 43 "@types/node": "^12.12.21",
42 "@types/seedrandom": "^2.4.28", 44 "@types/seedrandom": "^2.4.28",
43 "@types/vscode": "^1.37.0", 45 "@types/vscode": "^1.41.0",
44 "glob": "^7.1.4", 46 "glob": "^7.1.6",
45 "mocha": "^6.2.0", 47 "mocha": "^6.2.2",
46 "prettier": "^1.18.2", 48 "prettier": "^1.19.1",
47 "rollup": "^1.23.1", 49 "rollup": "^1.27.13",
48 "rollup-plugin-commonjs": "^10.1.0", 50 "rollup-plugin-commonjs": "^10.1.0",
49 "rollup-plugin-node-resolve": "^5.2.0", 51 "rollup-plugin-node-resolve": "^5.2.0",
52 "rollup-plugin-sourcemaps": "^0.4.2",
50 "rollup-plugin-typescript": "^1.0.1", 53 "rollup-plugin-typescript": "^1.0.1",
51 "shx": "^0.3.1", 54 "shx": "^0.3.1",
52 "tslint": "^5.18.0", 55 "tslint": "^5.20.1",
53 "tslint-config-prettier": "^1.18.0", 56 "tslint-config-prettier": "^1.18.0",
54 "typescript": "^3.5.3", 57 "tslint-plugin-prettier": "^2.0.1",
55 "vsce": "^1.67.0", 58 "typescript": "^3.7.3",
56 "vscode-test": "^1.2.0" 59 "vsce": "^1.71.0",
60 "vscode-test": "^1.3.0"
57 }, 61 },
58 "activationEvents": [ 62 "activationEvents": [
59 "onLanguage:rust", 63 "onLanguage:rust",
@@ -279,7 +283,7 @@
279 }, 283 },
280 "rust-analyzer.useClientWatching": { 284 "rust-analyzer.useClientWatching": {
281 "type": "boolean", 285 "type": "boolean",
282 "default": false, 286 "default": true,
283 "description": "client provided file watching instead of notify watching." 287 "description": "client provided file watching instead of notify watching."
284 }, 288 },
285 "rust-analyzer.cargo-watch.arguments": { 289 "rust-analyzer.cargo-watch.arguments": {
@@ -297,6 +301,11 @@
297 "description": "A list of patterns for cargo-watch to ignore (will be passed as `--ignore`)", 301 "description": "A list of patterns for cargo-watch to ignore (will be passed as `--ignore`)",
298 "default": [] 302 "default": []
299 }, 303 },
304 "rust-analyzer.cargo-watch.allTargets": {
305 "type": "boolean",
306 "description": "Check all targets and tests (will be passed as `--all-targets`)",
307 "default": true
308 },
300 "rust-analyzer.trace.server": { 309 "rust-analyzer.trace.server": {
301 "type": "string", 310 "type": "string",
302 "scope": "window", 311 "scope": "window",
@@ -338,6 +347,21 @@
338 "type": "number", 347 "type": "number",
339 "default": 20, 348 "default": 20,
340 "description": "Maximum length for inlay hints" 349 "description": "Maximum length for inlay hints"
350 },
351 "rust-analyzer.cargoFeatures.noDefaultFeatures": {
352 "type": "boolean",
353 "default": false,
354 "description": "Do not activate the `default` feature"
355 },
356 "rust-analyzer.cargoFeatures.allFeatures": {
357 "type": "boolean",
358 "default": true,
359 "description": "Activate all available features"
360 },
361 "rust-analyzer.cargoFeatures.features": {
362 "type": "array",
363 "default": [],
364 "description": "List of features to activate"
341 } 365 }
342 } 366 }
343 }, 367 },
@@ -358,6 +382,20 @@
358 "column": 3 382 "column": 3
359 } 383 }
360 ] 384 ]
385 },
386 {
387 "name": "rustc-json",
388 "patterns": [
389 {
390 "regexp": "^.*\"message\":{\"message\":\"([^\"]*).*?\"file_name\":\"([^\"]+).*?\"line_start\":(\\d+).*?\"line_end\":(\\d+).*?\"column_start\":(\\d+).*?\"column_end\":(\\d+).*}$",
391 "message": 1,
392 "file": 2,
393 "line": 3,
394 "endLine": 4,
395 "column": 5,
396 "endColumn": 6
397 }
398 ]
361 } 399 }
362 ], 400 ],
363 "problemMatchers": [ 401 "problemMatchers": [
@@ -370,6 +408,14 @@
370 "pattern": "$rustc" 408 "pattern": "$rustc"
371 }, 409 },
372 { 410 {
411 "name": "rustc-json",
412 "fileLocation": [
413 "relative",
414 "${workspaceRoot}"
415 ],
416 "pattern": "$rustc-json"
417 },
418 {
373 "name": "rustc-watch", 419 "name": "rustc-watch",
374 "fileLocation": [ 420 "fileLocation": [
375 "relative", 421 "relative",
@@ -483,6 +529,33 @@
483 } 529 }
484 }, 530 },
485 { 531 {
532 "id": "ralsp.literal.numeric",
533 "description": "Color for numeric literals",
534 "defaults": {
535 "dark": "#BECEA8",
536 "light": "#09885A",
537 "highContrast": "#B5CEA8"
538 }
539 },
540 {
541 "id": "ralsp.literal.char",
542 "description": "Color for character literals",
543 "defaults": {
544 "dark": "#BECEA8",
545 "light": "#09885A",
546 "highContrast": "#B5CEA8"
547 }
548 },
549 {
550 "id": "ralsp.literal.byte",
551 "description": "Color for byte literals",
552 "defaults": {
553 "dark": "#BECEA8",
554 "light": "#09885A",
555 "highContrast": "#B5CEA8"
556 }
557 },
558 {
486 "id": "ralsp.macro", 559 "id": "ralsp.macro",
487 "description": "Color for macros", 560 "description": "Color for macros",
488 "defaults": { 561 "defaults": {
@@ -502,7 +575,43 @@
502 }, 575 },
503 { 576 {
504 "id": "ralsp.type", 577 "id": "ralsp.type",
505 "description": "Color for types", 578 "description": "Color for other types (traits, aliases..)",
579 "defaults": {
580 "dark": "#4EC9B0",
581 "light": "#267F99",
582 "highContrast": "#4EC9B0"
583 }
584 },
585 {
586 "id": "ralsp.type.builtin",
587 "description": "Color for built-in types (&str, bool, u16, u32)",
588 "defaults": {
589 "dark": "#4EC9B0",
590 "light": "#267F99",
591 "highContrast": "#4EC9B0"
592 }
593 },
594 {
595 "id": "ralsp.type.lifetime",
596 "description": "Color for lifetimes parameters",
597 "defaults": {
598 "dark": "#4EC9B0",
599 "light": "#267F99",
600 "highContrast": "#4EC9B0"
601 }
602 },
603 {
604 "id": "ralsp.type.self",
605 "description": "Color for `Self` param type",
606 "defaults": {
607 "dark": "#4EC9B0",
608 "light": "#267F99",
609 "highContrast": "#4EC9B0"
610 }
611 },
612 {
613 "id": "ralsp.type.param",
614 "description": "Color for type parameters",
506 "defaults": { 615 "defaults": {
507 "dark": "#4EC9B0", 616 "dark": "#4EC9B0",
508 "light": "#267F99", 617 "light": "#267F99",
diff --git a/editors/code/rollup.config.js b/editors/code/rollup.config.js
index a023b8c3f..1b222bbe7 100644
--- a/editors/code/rollup.config.js
+++ b/editors/code/rollup.config.js
@@ -1,12 +1,14 @@
1import typescript from 'rollup-plugin-typescript'; 1import typescript from 'rollup-plugin-typescript';
2import resolve from 'rollup-plugin-node-resolve'; 2import resolve from 'rollup-plugin-node-resolve';
3import commonjs from 'rollup-plugin-commonjs'; 3import commonjs from 'rollup-plugin-commonjs';
4import sourcemaps from 'rollup-plugin-sourcemaps'
4import nodeBuiltins from 'builtin-modules'; 5import nodeBuiltins from 'builtin-modules';
5 6
6export default { 7export default {
7 input: './src/extension.ts', 8 input: './src/extension.ts',
8 plugins: [ 9 plugins: [
9 typescript(), 10 typescript(),
11 sourcemaps(),
10 resolve(), 12 resolve(),
11 commonjs({ 13 commonjs({
12 namedExports: { 14 namedExports: {
@@ -22,6 +24,7 @@ export default {
22 ], 24 ],
23 output: { 25 output: {
24 file: './bundle/extension.js', 26 file: './bundle/extension.js',
27 sourcemap: true,
25 format: 'cjs', 28 format: 'cjs',
26 } 29 }
27}; 30};
diff --git a/editors/code/src/commands/analyzer_status.ts b/editors/code/src/commands/analyzer_status.ts
index 63f82c92d..2777ced24 100644
--- a/editors/code/src/commands/analyzer_status.ts
+++ b/editors/code/src/commands/analyzer_status.ts
@@ -9,7 +9,7 @@ export class TextDocumentContentProvider
9 public syntaxTree: string = 'Not available'; 9 public syntaxTree: string = 'Not available';
10 10
11 public provideTextDocumentContent( 11 public provideTextDocumentContent(
12 uri: vscode.Uri 12 _uri: vscode.Uri,
13 ): vscode.ProviderResult<string> { 13 ): vscode.ProviderResult<string> {
14 const editor = vscode.window.activeTextEditor; 14 const editor = vscode.window.activeTextEditor;
15 if (editor == null) { 15 if (editor == null) {
@@ -17,7 +17,7 @@ export class TextDocumentContentProvider
17 } 17 }
18 return Server.client.sendRequest<string>( 18 return Server.client.sendRequest<string>(
19 'rust-analyzer/analyzerStatus', 19 'rust-analyzer/analyzerStatus',
20 null 20 null,
21 ); 21 );
22 } 22 }
23 23
@@ -35,8 +35,8 @@ export function makeCommand(context: vscode.ExtensionContext) {
35 context.subscriptions.push( 35 context.subscriptions.push(
36 vscode.workspace.registerTextDocumentContentProvider( 36 vscode.workspace.registerTextDocumentContentProvider(
37 'rust-analyzer-status', 37 'rust-analyzer-status',
38 textDocumentContentProvider 38 textDocumentContentProvider,
39 ) 39 ),
40 ); 40 );
41 41
42 context.subscriptions.push({ 42 context.subscriptions.push({
@@ -44,21 +44,21 @@ export function makeCommand(context: vscode.ExtensionContext) {
44 if (poller != null) { 44 if (poller != null) {
45 clearInterval(poller); 45 clearInterval(poller);
46 } 46 }
47 } 47 },
48 }); 48 });
49 49
50 return async function handle() { 50 return async function handle() {
51 if (poller == null) { 51 if (poller == null) {
52 poller = setInterval( 52 poller = setInterval(
53 () => textDocumentContentProvider.eventEmitter.fire(statusUri), 53 () => textDocumentContentProvider.eventEmitter.fire(statusUri),
54 1000 54 1000,
55 ); 55 );
56 } 56 }
57 const document = await vscode.workspace.openTextDocument(statusUri); 57 const document = await vscode.workspace.openTextDocument(statusUri);
58 return vscode.window.showTextDocument( 58 return vscode.window.showTextDocument(
59 document, 59 document,
60 vscode.ViewColumn.Two, 60 vscode.ViewColumn.Two,
61 true 61 true,
62 ); 62 );
63 }; 63 };
64} 64}
diff --git a/editors/code/src/commands/apply_source_change.ts b/editors/code/src/commands/apply_source_change.ts
index dcd074b8b..8167398b1 100644
--- a/editors/code/src/commands/apply_source_change.ts
+++ b/editors/code/src/commands/apply_source_change.ts
@@ -11,7 +11,7 @@ export interface SourceChange {
11 11
12export async function handle(change: SourceChange) { 12export async function handle(change: SourceChange) {
13 const wsEdit = Server.client.protocol2CodeConverter.asWorkspaceEdit( 13 const wsEdit = Server.client.protocol2CodeConverter.asWorkspaceEdit(
14 change.workspaceEdit 14 change.workspaceEdit,
15 ); 15 );
16 let created; 16 let created;
17 let moved; 17 let moved;
@@ -33,10 +33,10 @@ export async function handle(change: SourceChange) {
33 await vscode.window.showTextDocument(doc); 33 await vscode.window.showTextDocument(doc);
34 } else if (toReveal) { 34 } else if (toReveal) {
35 const uri = Server.client.protocol2CodeConverter.asUri( 35 const uri = Server.client.protocol2CodeConverter.asUri(
36 toReveal.textDocument.uri 36 toReveal.textDocument.uri,
37 ); 37 );
38 const position = Server.client.protocol2CodeConverter.asPosition( 38 const position = Server.client.protocol2CodeConverter.asPosition(
39 toReveal.position 39 toReveal.position,
40 ); 40 );
41 const editor = vscode.window.activeTextEditor; 41 const editor = vscode.window.activeTextEditor;
42 if (!editor || editor.document.uri.toString() !== uri.toString()) { 42 if (!editor || editor.document.uri.toString() !== uri.toString()) {
@@ -48,7 +48,7 @@ export async function handle(change: SourceChange) {
48 editor.selection = new vscode.Selection(position, position); 48 editor.selection = new vscode.Selection(position, position);
49 editor.revealRange( 49 editor.revealRange(
50 new vscode.Range(position, position), 50 new vscode.Range(position, position),
51 vscode.TextEditorRevealType.Default 51 vscode.TextEditorRevealType.Default,
52 ); 52 );
53 } 53 }
54} 54}
diff --git a/editors/code/src/commands/cargo_watch.ts b/editors/code/src/commands/cargo_watch.ts
index 59d4ba97a..ac62bdd48 100644
--- a/editors/code/src/commands/cargo_watch.ts
+++ b/editors/code/src/commands/cargo_watch.ts
@@ -9,13 +9,13 @@ import { StatusDisplay } from './watch_status';
9 9
10import { 10import {
11 mapRustDiagnosticToVsCode, 11 mapRustDiagnosticToVsCode,
12 RustDiagnostic 12 RustDiagnostic,
13} from '../utils/diagnostics/rust'; 13} from '../utils/diagnostics/rust';
14import SuggestedFixCollection from '../utils/diagnostics/SuggestedFixCollection'; 14import SuggestedFixCollection from '../utils/diagnostics/SuggestedFixCollection';
15import { areDiagnosticsEqual } from '../utils/diagnostics/vscode'; 15import { areDiagnosticsEqual } from '../utils/diagnostics/vscode';
16 16
17export async function registerCargoWatchProvider( 17export async function registerCargoWatchProvider(
18 subscriptions: vscode.Disposable[] 18 subscriptions: vscode.Disposable[],
19): Promise<CargoWatchProvider | undefined> { 19): Promise<CargoWatchProvider | undefined> {
20 let cargoExists = false; 20 let cargoExists = false;
21 21
@@ -30,7 +30,7 @@ export async function registerCargoWatchProvider(
30 30
31 if (!cargoExists) { 31 if (!cargoExists) {
32 vscode.window.showErrorMessage( 32 vscode.window.showErrorMessage(
33 `Couldn\'t find \'Cargo.toml\' at ${cargoTomlPath}` 33 `Couldn\'t find \'Cargo.toml\' at ${cargoTomlPath}`,
34 ); 34 );
35 return; 35 return;
36 } 36 }
@@ -52,13 +52,13 @@ export class CargoWatchProvider implements vscode.Disposable {
52 52
53 constructor() { 53 constructor() {
54 this.diagnosticCollection = vscode.languages.createDiagnosticCollection( 54 this.diagnosticCollection = vscode.languages.createDiagnosticCollection(
55 'rustc' 55 'rustc',
56 ); 56 );
57 this.statusDisplay = new StatusDisplay( 57 this.statusDisplay = new StatusDisplay(
58 Server.config.cargoWatchOptions.command 58 Server.config.cargoWatchOptions.command,
59 ); 59 );
60 this.outputChannel = vscode.window.createOutputChannel( 60 this.outputChannel = vscode.window.createOutputChannel(
61 'Cargo Watch Trace' 61 'Cargo Watch Trace',
62 ); 62 );
63 63
64 // Track `rustc`'s suggested fixes so we can convert them to code actions 64 // Track `rustc`'s suggested fixes so we can convert them to code actions
@@ -68,22 +68,24 @@ export class CargoWatchProvider implements vscode.Disposable {
68 this.suggestedFixCollection, 68 this.suggestedFixCollection,
69 { 69 {
70 providedCodeActionKinds: 70 providedCodeActionKinds:
71 SuggestedFixCollection.PROVIDED_CODE_ACTION_KINDS 71 SuggestedFixCollection.PROVIDED_CODE_ACTION_KINDS,
72 } 72 },
73 ); 73 );
74 } 74 }
75 75
76 public start() { 76 public start() {
77 if (this.cargoProcess) { 77 if (this.cargoProcess) {
78 vscode.window.showInformationMessage( 78 vscode.window.showInformationMessage(
79 'Cargo Watch is already running' 79 'Cargo Watch is already running',
80 ); 80 );
81 return; 81 return;
82 } 82 }
83 83
84 let args = 84 let args =
85 Server.config.cargoWatchOptions.command + 85 Server.config.cargoWatchOptions.command + ' --message-format json';
86 ' --all-targets --message-format json'; 86 if (Server.config.cargoWatchOptions.allTargets) {
87 args += ' --all-targets';
88 }
87 if (Server.config.cargoWatchOptions.command.length > 0) { 89 if (Server.config.cargoWatchOptions.command.length > 0) {
88 // Excape the double quote string: 90 // Excape the double quote string:
89 args += ' ' + Server.config.cargoWatchOptions.arguments; 91 args += ' ' + Server.config.cargoWatchOptions.arguments;
@@ -95,7 +97,7 @@ export class CargoWatchProvider implements vscode.Disposable {
95 97
96 const ignoreFlags = Server.config.cargoWatchOptions.ignore.reduce( 98 const ignoreFlags = Server.config.cargoWatchOptions.ignore.reduce(
97 (flags, pattern) => [...flags, '--ignore', pattern], 99 (flags, pattern) => [...flags, '--ignore', pattern],
98 [] as string[] 100 [] as string[],
99 ); 101 );
100 102
101 // Start the cargo watch with json message 103 // Start the cargo watch with json message
@@ -105,12 +107,17 @@ export class CargoWatchProvider implements vscode.Disposable {
105 { 107 {
106 stdio: ['ignore', 'pipe', 'pipe'], 108 stdio: ['ignore', 'pipe', 'pipe'],
107 cwd: vscode.workspace.rootPath, 109 cwd: vscode.workspace.rootPath,
108 windowsVerbatimArguments: true 110 windowsVerbatimArguments: true,
109 } 111 },
110 ); 112 );
111 113
114 if (!this.cargoProcess) {
115 vscode.window.showErrorMessage('Cargo Watch failed to start');
116 return;
117 }
118
112 const stdoutData = new LineBuffer(); 119 const stdoutData = new LineBuffer();
113 this.cargoProcess.stdout.on('data', (s: string) => { 120 this.cargoProcess.stdout?.on('data', (s: string) => {
114 stdoutData.processOutput(s, line => { 121 stdoutData.processOutput(s, line => {
115 this.logInfo(line); 122 this.logInfo(line);
116 try { 123 try {
@@ -122,7 +129,7 @@ export class CargoWatchProvider implements vscode.Disposable {
122 }); 129 });
123 130
124 const stderrData = new LineBuffer(); 131 const stderrData = new LineBuffer();
125 this.cargoProcess.stderr.on('data', (s: string) => { 132 this.cargoProcess.stderr?.on('data', (s: string) => {
126 stderrData.processOutput(s, line => { 133 stderrData.processOutput(s, line => {
127 this.logError('Error on cargo-watch : {\n' + line + '}\n'); 134 this.logError('Error on cargo-watch : {\n' + line + '}\n');
128 }); 135 });
@@ -130,7 +137,7 @@ export class CargoWatchProvider implements vscode.Disposable {
130 137
131 this.cargoProcess.on('error', (err: Error) => { 138 this.cargoProcess.on('error', (err: Error) => {
132 this.logError( 139 this.logError(
133 'Error on cargo-watch process : {\n' + err.message + '}\n' 140 'Error on cargo-watch process : {\n' + err.message + '}\n',
134 ); 141 );
135 }); 142 });
136 143
@@ -223,12 +230,12 @@ export class CargoWatchProvider implements vscode.Disposable {
223 const fileUri = location.uri; 230 const fileUri = location.uri;
224 231
225 const diagnostics: vscode.Diagnostic[] = [ 232 const diagnostics: vscode.Diagnostic[] = [
226 ...(this.diagnosticCollection!.get(fileUri) || []) 233 ...(this.diagnosticCollection!.get(fileUri) || []),
227 ]; 234 ];
228 235
229 // If we're building multiple targets it's possible we've already seen this diagnostic 236 // If we're building multiple targets it's possible we've already seen this diagnostic
230 const isDuplicate = diagnostics.some(d => 237 const isDuplicate = diagnostics.some(d =>
231 areDiagnosticsEqual(d, diagnostic) 238 areDiagnosticsEqual(d, diagnostic),
232 ); 239 );
233 if (isDuplicate) { 240 if (isDuplicate) {
234 return; 241 return;
@@ -241,7 +248,7 @@ export class CargoWatchProvider implements vscode.Disposable {
241 for (const suggestedFix of suggestedFixes) { 248 for (const suggestedFix of suggestedFixes) {
242 this.suggestedFixCollection.addSuggestedFixForDiagnostic( 249 this.suggestedFixCollection.addSuggestedFixForDiagnostic(
243 suggestedFix, 250 suggestedFix,
244 diagnostic 251 diagnostic,
245 ); 252 );
246 } 253 }
247 254
@@ -249,7 +256,7 @@ export class CargoWatchProvider implements vscode.Disposable {
249 vscode.commands.executeCommand( 256 vscode.commands.executeCommand(
250 'vscode.executeCodeActionProvider', 257 'vscode.executeCodeActionProvider',
251 fileUri, 258 fileUri,
252 diagnostic.range 259 diagnostic.range,
253 ); 260 );
254 } 261 }
255 } 262 }
diff --git a/editors/code/src/commands/expand_macro.ts b/editors/code/src/commands/expand_macro.ts
index 34e0c8fb3..17c78280a 100644
--- a/editors/code/src/commands/expand_macro.ts
+++ b/editors/code/src/commands/expand_macro.ts
@@ -3,7 +3,7 @@ import { Position, TextDocumentIdentifier } from 'vscode-languageclient';
3import { Server } from '../server'; 3import { Server } from '../server';
4 4
5export const expandMacroUri = vscode.Uri.parse( 5export const expandMacroUri = vscode.Uri.parse(
6 'rust-analyzer://expandMacro/[EXPANSION].rs' 6 'rust-analyzer://expandMacro/[EXPANSION].rs',
7); 7);
8 8
9export class ExpandMacroContentProvider 9export class ExpandMacroContentProvider
@@ -11,7 +11,7 @@ export class ExpandMacroContentProvider
11 public eventEmitter = new vscode.EventEmitter<vscode.Uri>(); 11 public eventEmitter = new vscode.EventEmitter<vscode.Uri>();
12 12
13 public provideTextDocumentContent( 13 public provideTextDocumentContent(
14 uri: vscode.Uri 14 _uri: vscode.Uri,
15 ): vscode.ProviderResult<string> { 15 ): vscode.ProviderResult<string> {
16 async function handle() { 16 async function handle() {
17 const editor = vscode.window.activeTextEditor; 17 const editor = vscode.window.activeTextEditor;
@@ -22,11 +22,11 @@ export class ExpandMacroContentProvider
22 const position = editor.selection.active; 22 const position = editor.selection.active;
23 const request: MacroExpandParams = { 23 const request: MacroExpandParams = {
24 textDocument: { uri: editor.document.uri.toString() }, 24 textDocument: { uri: editor.document.uri.toString() },
25 position 25 position,
26 }; 26 };
27 const expanded = await Server.client.sendRequest<ExpandedMacro>( 27 const expanded = await Server.client.sendRequest<ExpandedMacro>(
28 'rust-analyzer/expandMacro', 28 'rust-analyzer/expandMacro',
29 request 29 request,
30 ); 30 );
31 31
32 if (expanded == null) { 32 if (expanded == null) {
@@ -58,7 +58,7 @@ export function createHandle(provider: ExpandMacroContentProvider) {
58 return vscode.window.showTextDocument( 58 return vscode.window.showTextDocument(
59 document, 59 document,
60 vscode.ViewColumn.Two, 60 vscode.ViewColumn.Two,
61 true 61 true,
62 ); 62 );
63 }; 63 };
64} 64}
diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts
index 2ade6d331..13a696758 100644
--- a/editors/code/src/commands/index.ts
+++ b/editors/code/src/commands/index.ts
@@ -19,5 +19,5 @@ export {
19 runnables, 19 runnables,
20 syntaxTree, 20 syntaxTree,
21 onEnter, 21 onEnter,
22 inlayHints 22 inlayHints,
23}; 23};
diff --git a/editors/code/src/commands/inlay_hints.ts b/editors/code/src/commands/inlay_hints.ts
index 0dbdd94fb..ac7dcce60 100644
--- a/editors/code/src/commands/inlay_hints.ts
+++ b/editors/code/src/commands/inlay_hints.ts
@@ -15,8 +15,8 @@ interface InlayHint {
15 15
16const typeHintDecorationType = vscode.window.createTextEditorDecorationType({ 16const typeHintDecorationType = vscode.window.createTextEditorDecorationType({
17 after: { 17 after: {
18 color: new vscode.ThemeColor('ralsp.inlayHint') 18 color: new vscode.ThemeColor('ralsp.inlayHint'),
19 } 19 },
20}); 20});
21 21
22export class HintsUpdater { 22export class HintsUpdater {
@@ -26,13 +26,13 @@ export class HintsUpdater {
26 if (this.displayHints !== displayHints) { 26 if (this.displayHints !== displayHints) {
27 this.displayHints = displayHints; 27 this.displayHints = displayHints;
28 return this.refreshVisibleEditorsHints( 28 return this.refreshVisibleEditorsHints(
29 displayHints ? undefined : [] 29 displayHints ? undefined : [],
30 ); 30 );
31 } 31 }
32 } 32 }
33 33
34 public async refreshHintsForVisibleEditors( 34 public async refreshHintsForVisibleEditors(
35 cause?: TextDocumentChangeEvent 35 cause?: TextDocumentChangeEvent,
36 ): Promise<void> { 36 ): Promise<void> {
37 if (!this.displayHints) { 37 if (!this.displayHints) {
38 return; 38 return;
@@ -48,21 +48,21 @@ export class HintsUpdater {
48 } 48 }
49 49
50 private async refreshVisibleEditorsHints( 50 private async refreshVisibleEditorsHints(
51 newDecorations?: vscode.DecorationOptions[] 51 newDecorations?: vscode.DecorationOptions[],
52 ) { 52 ) {
53 const promises: Array<Promise<void>> = []; 53 const promises: Array<Promise<void>> = [];
54 54
55 for (const rustEditor of vscode.window.visibleTextEditors.filter( 55 for (const rustEditor of vscode.window.visibleTextEditors.filter(
56 editor => this.isRustDocument(editor.document) 56 editor => this.isRustDocument(editor.document),
57 )) { 57 )) {
58 if (newDecorations !== undefined) { 58 if (newDecorations !== undefined) {
59 promises.push( 59 promises.push(
60 Promise.resolve( 60 Promise.resolve(
61 rustEditor.setDecorations( 61 rustEditor.setDecorations(
62 typeHintDecorationType, 62 typeHintDecorationType,
63 newDecorations 63 newDecorations,
64 ) 64 ),
65 ) 65 ),
66 ); 66 );
67 } else { 67 } else {
68 promises.push(this.updateDecorationsFromServer(rustEditor)); 68 promises.push(this.updateDecorationsFromServer(rustEditor));
@@ -79,7 +79,7 @@ export class HintsUpdater {
79 } 79 }
80 80
81 private async updateDecorationsFromServer( 81 private async updateDecorationsFromServer(
82 editor: TextEditor 82 editor: TextEditor,
83 ): Promise<void> { 83 ): Promise<void> {
84 const newHints = await this.queryHints(editor.document.uri.toString()); 84 const newHints = await this.queryHints(editor.document.uri.toString());
85 if (newHints !== null) { 85 if (newHints !== null) {
@@ -87,20 +87,20 @@ export class HintsUpdater {
87 range: hint.range, 87 range: hint.range,
88 renderOptions: { 88 renderOptions: {
89 after: { 89 after: {
90 contentText: `: ${hint.label}` 90 contentText: `: ${hint.label}`,
91 } 91 },
92 } 92 },
93 })); 93 }));
94 return editor.setDecorations( 94 return editor.setDecorations(
95 typeHintDecorationType, 95 typeHintDecorationType,
96 newDecorations 96 newDecorations,
97 ); 97 );
98 } 98 }
99 } 99 }
100 100
101 private async queryHints(documentUri: string): Promise<InlayHint[] | null> { 101 private async queryHints(documentUri: string): Promise<InlayHint[] | null> {
102 const request: InlayHintsParams = { 102 const request: InlayHintsParams = {
103 textDocument: { uri: documentUri } 103 textDocument: { uri: documentUri },
104 }; 104 };
105 const client = Server.client; 105 const client = Server.client;
106 return client 106 return client
@@ -108,8 +108,8 @@ export class HintsUpdater {
108 .then(() => 108 .then(() =>
109 client.sendRequest<InlayHint[] | null>( 109 client.sendRequest<InlayHint[] | null>(
110 'rust-analyzer/inlayHints', 110 'rust-analyzer/inlayHints',
111 request 111 request,
112 ) 112 ),
113 ); 113 );
114 } 114 }
115} 115}
diff --git a/editors/code/src/commands/join_lines.ts b/editors/code/src/commands/join_lines.ts
index 0d4b12f4d..134ddc801 100644
--- a/editors/code/src/commands/join_lines.ts
+++ b/editors/code/src/commands/join_lines.ts
@@ -4,7 +4,7 @@ import { Range, TextDocumentIdentifier } from 'vscode-languageclient';
4import { Server } from '../server'; 4import { Server } from '../server';
5import { 5import {
6 handle as applySourceChange, 6 handle as applySourceChange,
7 SourceChange 7 SourceChange,
8} from './apply_source_change'; 8} from './apply_source_change';
9 9
10interface JoinLinesParams { 10interface JoinLinesParams {
@@ -19,11 +19,11 @@ export async function handle() {
19 } 19 }
20 const request: JoinLinesParams = { 20 const request: JoinLinesParams = {
21 range: Server.client.code2ProtocolConverter.asRange(editor.selection), 21 range: Server.client.code2ProtocolConverter.asRange(editor.selection),
22 textDocument: { uri: editor.document.uri.toString() } 22 textDocument: { uri: editor.document.uri.toString() },
23 }; 23 };
24 const change = await Server.client.sendRequest<SourceChange>( 24 const change = await Server.client.sendRequest<SourceChange>(
25 'rust-analyzer/joinLines', 25 'rust-analyzer/joinLines',
26 request 26 request,
27 ); 27 );
28 await applySourceChange(change); 28 await applySourceChange(change);
29} 29}
diff --git a/editors/code/src/commands/matching_brace.ts b/editors/code/src/commands/matching_brace.ts
index d86faf405..364208cc7 100644
--- a/editors/code/src/commands/matching_brace.ts
+++ b/editors/code/src/commands/matching_brace.ts
@@ -17,15 +17,15 @@ export async function handle() {
17 textDocument: { uri: editor.document.uri.toString() }, 17 textDocument: { uri: editor.document.uri.toString() },
18 offsets: editor.selections.map(s => { 18 offsets: editor.selections.map(s => {
19 return Server.client.code2ProtocolConverter.asPosition(s.active); 19 return Server.client.code2ProtocolConverter.asPosition(s.active);
20 }) 20 }),
21 }; 21 };
22 const response = await Server.client.sendRequest<Position[]>( 22 const response = await Server.client.sendRequest<Position[]>(
23 'rust-analyzer/findMatchingBrace', 23 'rust-analyzer/findMatchingBrace',
24 request 24 request,
25 ); 25 );
26 editor.selections = editor.selections.map((sel, idx) => { 26 editor.selections = editor.selections.map((sel, idx) => {
27 const active = Server.client.protocol2CodeConverter.asPosition( 27 const active = Server.client.protocol2CodeConverter.asPosition(
28 response[idx] 28 response[idx],
29 ); 29 );
30 const anchor = sel.isEmpty ? active : sel.anchor; 30 const anchor = sel.isEmpty ? active : sel.anchor;
31 return new vscode.Selection(anchor, active); 31 return new vscode.Selection(anchor, active);
diff --git a/editors/code/src/commands/on_enter.ts b/editors/code/src/commands/on_enter.ts
index 16dcb70c8..772c64b3c 100644
--- a/editors/code/src/commands/on_enter.ts
+++ b/editors/code/src/commands/on_enter.ts
@@ -3,7 +3,7 @@ import * as lc from 'vscode-languageclient';
3import { Server } from '../server'; 3import { Server } from '../server';
4import { 4import {
5 handle as applySourceChange, 5 handle as applySourceChange,
6 SourceChange 6 SourceChange,
7} from './apply_source_change'; 7} from './apply_source_change';
8 8
9export async function handle(event: { text: string }): Promise<boolean> { 9export async function handle(event: { text: string }): Promise<boolean> {
@@ -18,12 +18,12 @@ export async function handle(event: { text: string }): Promise<boolean> {
18 const request: lc.TextDocumentPositionParams = { 18 const request: lc.TextDocumentPositionParams = {
19 textDocument: { uri: editor.document.uri.toString() }, 19 textDocument: { uri: editor.document.uri.toString() },
20 position: Server.client.code2ProtocolConverter.asPosition( 20 position: Server.client.code2ProtocolConverter.asPosition(
21 editor.selection.active 21 editor.selection.active,
22 ) 22 ),
23 }; 23 };
24 const change = await Server.client.sendRequest<undefined | SourceChange>( 24 const change = await Server.client.sendRequest<undefined | SourceChange>(
25 'rust-analyzer/onEnter', 25 'rust-analyzer/onEnter',
26 request 26 request,
27 ); 27 );
28 if (!change) { 28 if (!change) {
29 return false; 29 return false;
diff --git a/editors/code/src/commands/parent_module.ts b/editors/code/src/commands/parent_module.ts
index 9d30b7b59..ad49e1bdb 100644
--- a/editors/code/src/commands/parent_module.ts
+++ b/editors/code/src/commands/parent_module.ts
@@ -11,12 +11,12 @@ export async function handle() {
11 const request: lc.TextDocumentPositionParams = { 11 const request: lc.TextDocumentPositionParams = {
12 textDocument: { uri: editor.document.uri.toString() }, 12 textDocument: { uri: editor.document.uri.toString() },
13 position: Server.client.code2ProtocolConverter.asPosition( 13 position: Server.client.code2ProtocolConverter.asPosition(
14 editor.selection.active 14 editor.selection.active,
15 ) 15 ),
16 }; 16 };
17 const response = await Server.client.sendRequest<lc.Location[]>( 17 const response = await Server.client.sendRequest<lc.Location[]>(
18 'rust-analyzer/parentModule', 18 'rust-analyzer/parentModule',
19 request 19 request,
20 ); 20 );
21 const loc = response[0]; 21 const loc = response[0];
22 if (loc == null) { 22 if (loc == null) {
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts
index ac59bf60d..cf980e257 100644
--- a/editors/code/src/commands/runnables.ts
+++ b/editors/code/src/commands/runnables.ts
@@ -46,17 +46,17 @@ function createTask(spec: Runnable): vscode.Task {
46 label: spec.label, 46 label: spec.label,
47 command: spec.bin, 47 command: spec.bin,
48 args: spec.args, 48 args: spec.args,
49 env: spec.env 49 env: spec.env,
50 }; 50 };
51 51
52 const execOption: vscode.ShellExecutionOptions = { 52 const execOption: vscode.ShellExecutionOptions = {
53 cwd: spec.cwd || '.', 53 cwd: spec.cwd || '.',
54 env: definition.env 54 env: definition.env,
55 }; 55 };
56 const exec = new vscode.ShellExecution( 56 const exec = new vscode.ShellExecution(
57 definition.command, 57 definition.command,
58 definition.args, 58 definition.args,
59 execOption 59 execOption,
60 ); 60 );
61 61
62 const f = vscode.workspace.workspaceFolders![0]; 62 const f = vscode.workspace.workspaceFolders![0];
@@ -66,30 +66,30 @@ function createTask(spec: Runnable): vscode.Task {
66 definition.label, 66 definition.label,
67 TASK_SOURCE, 67 TASK_SOURCE,
68 exec, 68 exec,
69 ['$rustc'] 69 ['$rustc'],
70 ); 70 );
71 t.presentationOptions.clear = true; 71 t.presentationOptions.clear = true;
72 return t; 72 return t;
73} 73}
74 74
75let prevRunnable: RunnableQuickPick | undefined; 75let prevRunnable: RunnableQuickPick | undefined;
76export async function handle() { 76export async function handle(): Promise<vscode.TaskExecution | undefined> {
77 const editor = vscode.window.activeTextEditor; 77 const editor = vscode.window.activeTextEditor;
78 if (editor == null || editor.document.languageId !== 'rust') { 78 if (editor == null || editor.document.languageId !== 'rust') {
79 return; 79 return;
80 } 80 }
81 const textDocument: lc.TextDocumentIdentifier = { 81 const textDocument: lc.TextDocumentIdentifier = {
82 uri: editor.document.uri.toString() 82 uri: editor.document.uri.toString(),
83 }; 83 };
84 const params: RunnablesParams = { 84 const params: RunnablesParams = {
85 textDocument, 85 textDocument,
86 position: Server.client.code2ProtocolConverter.asPosition( 86 position: Server.client.code2ProtocolConverter.asPosition(
87 editor.selection.active 87 editor.selection.active,
88 ) 88 ),
89 }; 89 };
90 const runnables = await Server.client.sendRequest<Runnable[]>( 90 const runnables = await Server.client.sendRequest<Runnable[]>(
91 'rust-analyzer/runnables', 91 'rust-analyzer/runnables',
92 params 92 params,
93 ); 93 );
94 const items: RunnableQuickPick[] = []; 94 const items: RunnableQuickPick[] = [];
95 if (prevRunnable) { 95 if (prevRunnable) {
@@ -105,12 +105,14 @@ export async function handle() {
105 items.push(new RunnableQuickPick(r)); 105 items.push(new RunnableQuickPick(r));
106 } 106 }
107 const item = await vscode.window.showQuickPick(items); 107 const item = await vscode.window.showQuickPick(items);
108 if (item) { 108 if (!item) {
109 item.detail = 'rerun'; 109 return;
110 prevRunnable = item;
111 const task = createTask(item.runnable);
112 return await vscode.tasks.executeTask(task);
113 } 110 }
111
112 item.detail = 'rerun';
113 prevRunnable = item;
114 const task = createTask(item.runnable);
115 return await vscode.tasks.executeTask(task);
114} 116}
115 117
116export async function handleSingle(runnable: Runnable) { 118export async function handleSingle(runnable: Runnable) {
@@ -124,7 +126,7 @@ export async function handleSingle(runnable: Runnable) {
124 task.presentationOptions = { 126 task.presentationOptions = {
125 reveal: vscode.TaskRevealKind.Always, 127 reveal: vscode.TaskRevealKind.Always,
126 panel: vscode.TaskPanelKind.Dedicated, 128 panel: vscode.TaskPanelKind.Dedicated,
127 clear: true 129 clear: true,
128 }; 130 };
129 131
130 return vscode.tasks.executeTask(task); 132 return vscode.tasks.executeTask(task);
@@ -136,7 +138,7 @@ export async function handleSingle(runnable: Runnable) {
136 * that, when accepted, allow us to `cargo install cargo-watch` and then run it. 138 * that, when accepted, allow us to `cargo install cargo-watch` and then run it.
137 */ 139 */
138export async function interactivelyStartCargoWatch( 140export async function interactivelyStartCargoWatch(
139 context: vscode.ExtensionContext 141 context: vscode.ExtensionContext,
140): Promise<CargoWatchProvider | undefined> { 142): Promise<CargoWatchProvider | undefined> {
141 if (Server.config.cargoWatchOptions.enableOnStartup === 'disabled') { 143 if (Server.config.cargoWatchOptions.enableOnStartup === 'disabled') {
142 return; 144 return;
@@ -146,7 +148,7 @@ export async function interactivelyStartCargoWatch(
146 const watch = await vscode.window.showInformationMessage( 148 const watch = await vscode.window.showInformationMessage(
147 'Start watching changes with cargo? (Executes `cargo watch`, provides inline diagnostics)', 149 'Start watching changes with cargo? (Executes `cargo watch`, provides inline diagnostics)',
148 'yes', 150 'yes',
149 'no' 151 'no',
150 ); 152 );
151 if (watch !== 'yes') { 153 if (watch !== 'yes') {
152 return; 154 return;
@@ -157,12 +159,12 @@ export async function interactivelyStartCargoWatch(
157} 159}
158 160
159export async function startCargoWatch( 161export async function startCargoWatch(
160 context: vscode.ExtensionContext 162 context: vscode.ExtensionContext,
161): Promise<CargoWatchProvider | undefined> { 163): Promise<CargoWatchProvider | undefined> {
162 const execPromise = util.promisify(child_process.exec); 164 const execPromise = util.promisify(child_process.exec);
163 165
164 const { stderr, code = 0 } = await execPromise( 166 const { stderr, code = 0 } = await execPromise(
165 'cargo watch --version' 167 'cargo watch --version',
166 ).catch(e => e); 168 ).catch(e => e);
167 169
168 if (stderr.includes('no such subcommand: `watch`')) { 170 if (stderr.includes('no such subcommand: `watch`')) {
@@ -171,14 +173,14 @@ export async function startCargoWatch(
171 const install = await vscode.window.showInformationMessage( 173 const install = await vscode.window.showInformationMessage(
172 msg, 174 msg,
173 'yes', 175 'yes',
174 'no' 176 'no',
175 ); 177 );
176 if (install !== 'yes') { 178 if (install !== 'yes') {
177 return; 179 return;
178 } 180 }
179 181
180 const label = 'install-cargo-watch'; 182 const label = 'install-cargo-watch';
181 const taskFinished = new Promise((resolve, reject) => { 183 const taskFinished = new Promise((resolve, _reject) => {
182 const disposable = vscode.tasks.onDidEndTask(({ execution }) => { 184 const disposable = vscode.tasks.onDidEndTask(({ execution }) => {
183 if (execution.task.name === label) { 185 if (execution.task.name === label) {
184 disposable.dispose(); 186 disposable.dispose();
@@ -192,20 +194,20 @@ export async function startCargoWatch(
192 label, 194 label,
193 bin: 'cargo', 195 bin: 'cargo',
194 args: ['install', 'cargo-watch'], 196 args: ['install', 'cargo-watch'],
195 env: {} 197 env: {},
196 }) 198 }),
197 ); 199 );
198 await taskFinished; 200 await taskFinished;
199 const output = await execPromise('cargo watch --version').catch(e => e); 201 const output = await execPromise('cargo watch --version').catch(e => e);
200 if (output.stderr !== '') { 202 if (output.stderr !== '') {
201 vscode.window.showErrorMessage( 203 vscode.window.showErrorMessage(
202 `Couldn't install \`cargo-\`watch: ${output.stderr}` 204 `Couldn't install \`cargo-\`watch: ${output.stderr}`,
203 ); 205 );
204 return; 206 return;
205 } 207 }
206 } else if (code !== 0) { 208 } else if (code !== 0) {
207 vscode.window.showErrorMessage( 209 vscode.window.showErrorMessage(
208 `\`cargo watch\` failed with ${code}: ${stderr}` 210 `\`cargo watch\` failed with ${code}: ${stderr}`,
209 ); 211 );
210 return; 212 return;
211 } 213 }
diff --git a/editors/code/src/commands/syntaxTree.ts b/editors/code/src/commands/syntaxTree.ts
index 2f50fe14b..89a80550c 100644
--- a/editors/code/src/commands/syntaxTree.ts
+++ b/editors/code/src/commands/syntaxTree.ts
@@ -11,7 +11,7 @@ export class SyntaxTreeContentProvider
11 public syntaxTree: string = 'Not available'; 11 public syntaxTree: string = 'Not available';
12 12
13 public provideTextDocumentContent( 13 public provideTextDocumentContent(
14 uri: vscode.Uri 14 uri: vscode.Uri,
15 ): vscode.ProviderResult<string> { 15 ): vscode.ProviderResult<string> {
16 const editor = vscode.window.activeTextEditor; 16 const editor = vscode.window.activeTextEditor;
17 if (editor == null) { 17 if (editor == null) {
@@ -25,17 +25,17 @@ export class SyntaxTreeContentProvider
25 range = editor.selection.isEmpty 25 range = editor.selection.isEmpty
26 ? undefined 26 ? undefined
27 : Server.client.code2ProtocolConverter.asRange( 27 : Server.client.code2ProtocolConverter.asRange(
28 editor.selection 28 editor.selection,
29 ); 29 );
30 } 30 }
31 31
32 const request: SyntaxTreeParams = { 32 const request: SyntaxTreeParams = {
33 textDocument: { uri: editor.document.uri.toString() }, 33 textDocument: { uri: editor.document.uri.toString() },
34 range 34 range,
35 }; 35 };
36 return Server.client.sendRequest<SyntaxTreeResult>( 36 return Server.client.sendRequest<SyntaxTreeResult>(
37 'rust-analyzer/syntaxTree', 37 'rust-analyzer/syntaxTree',
38 request 38 request,
39 ); 39 );
40 } 40 }
41 41
@@ -70,7 +70,7 @@ export function createHandle(provider: SyntaxTreeContentProvider) {
70 return vscode.window.showTextDocument( 70 return vscode.window.showTextDocument(
71 document, 71 document,
72 vscode.ViewColumn.Two, 72 vscode.ViewColumn.Two,
73 true 73 true,
74 ); 74 );
75 }; 75 };
76} 76}
diff --git a/editors/code/src/commands/watch_status.ts b/editors/code/src/commands/watch_status.ts
index 6c1f9041b..8d64394c7 100644
--- a/editors/code/src/commands/watch_status.ts
+++ b/editors/code/src/commands/watch_status.ts
@@ -13,7 +13,7 @@ export class StatusDisplay implements vscode.Disposable {
13 constructor(command: string) { 13 constructor(command: string) {
14 this.statusBarItem = vscode.window.createStatusBarItem( 14 this.statusBarItem = vscode.window.createStatusBarItem(
15 vscode.StatusBarAlignment.Left, 15 vscode.StatusBarAlignment.Left,
16 10 16 10,
17 ); 17 );
18 this.command = command; 18 this.command = command;
19 this.statusBarItem.hide(); 19 this.statusBarItem.hide();
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index 4cedbea46..c06dddb1c 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -14,6 +14,13 @@ export interface CargoWatchOptions {
14 command: string; 14 command: string;
15 trace: CargoWatchTraceOptions; 15 trace: CargoWatchTraceOptions;
16 ignore: string[]; 16 ignore: string[];
17 allTargets: boolean;
18}
19
20export interface CargoFeatures {
21 noDefaultFeatures: boolean;
22 allFeatures: boolean;
23 features: string[];
17} 24}
18 25
19export class Config { 26export class Config {
@@ -25,21 +32,30 @@ export class Config {
25 public displayInlayHints = true; 32 public displayInlayHints = true;
26 public maxInlayHintLength: null | number = null; 33 public maxInlayHintLength: null | number = null;
27 public excludeGlobs = []; 34 public excludeGlobs = [];
28 public useClientWatching = false; 35 public useClientWatching = true;
29 public featureFlags = {}; 36 public featureFlags = {};
37 // for internal use
38 public withSysroot: null | boolean = null;
30 public cargoWatchOptions: CargoWatchOptions = { 39 public cargoWatchOptions: CargoWatchOptions = {
31 enableOnStartup: 'ask', 40 enableOnStartup: 'ask',
32 trace: 'off', 41 trace: 'off',
33 arguments: '', 42 arguments: '',
34 command: '', 43 command: '',
35 ignore: [] 44 ignore: [],
45 allTargets: true,
46 };
47 public cargoFeatures: CargoFeatures = {
48 noDefaultFeatures: false,
49 allFeatures: true,
50 features: [],
36 }; 51 };
37 52
38 private prevEnhancedTyping: null | boolean = null; 53 private prevEnhancedTyping: null | boolean = null;
54 private prevCargoFeatures: null | CargoFeatures = null;
39 55
40 constructor() { 56 constructor() {
41 vscode.workspace.onDidChangeConfiguration(_ => 57 vscode.workspace.onDidChangeConfiguration(_ =>
42 this.userConfigChanged() 58 this.userConfigChanged(),
43 ); 59 );
44 this.userConfigChanged(); 60 this.userConfigChanged();
45 } 61 }
@@ -49,6 +65,8 @@ export class Config {
49 65
50 Server.highlighter.removeHighlights(); 66 Server.highlighter.removeHighlights();
51 67
68 let requireReloadMessage = null;
69
52 if (config.has('highlightingOn')) { 70 if (config.has('highlightingOn')) {
53 this.highlightingOn = config.get('highlightingOn') as boolean; 71 this.highlightingOn = config.get('highlightingOn') as boolean;
54 if (this.highlightingOn) { 72 if (this.highlightingOn) {
@@ -59,13 +77,13 @@ export class Config {
59 77
60 if (config.has('rainbowHighlightingOn')) { 78 if (config.has('rainbowHighlightingOn')) {
61 this.rainbowHighlightingOn = config.get( 79 this.rainbowHighlightingOn = config.get(
62 'rainbowHighlightingOn' 80 'rainbowHighlightingOn',
63 ) as boolean; 81 ) as boolean;
64 } 82 }
65 83
66 if (config.has('enableEnhancedTyping')) { 84 if (config.has('enableEnhancedTyping')) {
67 this.enableEnhancedTyping = config.get( 85 this.enableEnhancedTyping = config.get(
68 'enableEnhancedTyping' 86 'enableEnhancedTyping',
69 ) as boolean; 87 ) as boolean;
70 88
71 if (this.prevEnhancedTyping === null) { 89 if (this.prevEnhancedTyping === null) {
@@ -76,19 +94,8 @@ export class Config {
76 } 94 }
77 95
78 if (this.prevEnhancedTyping !== this.enableEnhancedTyping) { 96 if (this.prevEnhancedTyping !== this.enableEnhancedTyping) {
79 const reloadAction = 'Reload now'; 97 requireReloadMessage =
80 vscode.window 98 'Changing enhanced typing setting requires a reload';
81 .showInformationMessage(
82 'Changing enhanced typing setting requires a reload',
83 reloadAction
84 )
85 .then(selectedAction => {
86 if (selectedAction === reloadAction) {
87 vscode.commands.executeCommand(
88 'workbench.action.reloadWindow'
89 );
90 }
91 });
92 this.prevEnhancedTyping = this.enableEnhancedTyping; 99 this.prevEnhancedTyping = this.enableEnhancedTyping;
93 } 100 }
94 101
@@ -106,28 +113,35 @@ export class Config {
106 if (config.has('trace.cargo-watch')) { 113 if (config.has('trace.cargo-watch')) {
107 this.cargoWatchOptions.trace = config.get<CargoWatchTraceOptions>( 114 this.cargoWatchOptions.trace = config.get<CargoWatchTraceOptions>(
108 'trace.cargo-watch', 115 'trace.cargo-watch',
109 'off' 116 'off',
110 ); 117 );
111 } 118 }
112 119
113 if (config.has('cargo-watch.arguments')) { 120 if (config.has('cargo-watch.arguments')) {
114 this.cargoWatchOptions.arguments = config.get<string>( 121 this.cargoWatchOptions.arguments = config.get<string>(
115 'cargo-watch.arguments', 122 'cargo-watch.arguments',
116 '' 123 '',
117 ); 124 );
118 } 125 }
119 126
120 if (config.has('cargo-watch.command')) { 127 if (config.has('cargo-watch.command')) {
121 this.cargoWatchOptions.command = config.get<string>( 128 this.cargoWatchOptions.command = config.get<string>(
122 'cargo-watch.command', 129 'cargo-watch.command',
123 '' 130 '',
124 ); 131 );
125 } 132 }
126 133
127 if (config.has('cargo-watch.ignore')) { 134 if (config.has('cargo-watch.ignore')) {
128 this.cargoWatchOptions.ignore = config.get<string[]>( 135 this.cargoWatchOptions.ignore = config.get<string[]>(
129 'cargo-watch.ignore', 136 'cargo-watch.ignore',
130 [] 137 [],
138 );
139 }
140
141 if (config.has('cargo-watch.allTargets')) {
142 this.cargoWatchOptions.allTargets = config.get<boolean>(
143 'cargo-watch.allTargets',
144 true,
131 ); 145 );
132 } 146 }
133 147
@@ -140,17 +154,68 @@ export class Config {
140 } 154 }
141 if (config.has('maxInlayHintLength')) { 155 if (config.has('maxInlayHintLength')) {
142 this.maxInlayHintLength = config.get( 156 this.maxInlayHintLength = config.get(
143 'maxInlayHintLength' 157 'maxInlayHintLength',
144 ) as number; 158 ) as number;
145 } 159 }
146 if (config.has('excludeGlobs')) { 160 if (config.has('excludeGlobs')) {
147 this.excludeGlobs = config.get('excludeGlobs') || []; 161 this.excludeGlobs = config.get('excludeGlobs') || [];
148 } 162 }
149 if (config.has('useClientWatching')) { 163 if (config.has('useClientWatching')) {
150 this.useClientWatching = config.get('useClientWatching') || false; 164 this.useClientWatching = config.get('useClientWatching') || true;
151 } 165 }
152 if (config.has('featureFlags')) { 166 if (config.has('featureFlags')) {
153 this.featureFlags = config.get('featureFlags') || {}; 167 this.featureFlags = config.get('featureFlags') || {};
154 } 168 }
169 if (config.has('withSysroot')) {
170 this.withSysroot = config.get('withSysroot') || false;
171 }
172
173 if (config.has('cargoFeatures.noDefaultFeatures')) {
174 this.cargoFeatures.noDefaultFeatures = config.get(
175 'cargoFeatures.noDefaultFeatures',
176 false,
177 );
178 }
179 if (config.has('cargoFeatures.allFeatures')) {
180 this.cargoFeatures.allFeatures = config.get(
181 'cargoFeatures.allFeatures',
182 true,
183 );
184 }
185 if (config.has('cargoFeatures.features')) {
186 this.cargoFeatures.features = config.get(
187 'cargoFeatures.features',
188 [],
189 );
190 }
191
192 if (
193 this.prevCargoFeatures !== null &&
194 (this.cargoFeatures.allFeatures !==
195 this.prevCargoFeatures.allFeatures ||
196 this.cargoFeatures.noDefaultFeatures !==
197 this.prevCargoFeatures.noDefaultFeatures ||
198 this.cargoFeatures.features.length !==
199 this.prevCargoFeatures.features.length ||
200 this.cargoFeatures.features.some(
201 (v, i) => v !== this.prevCargoFeatures!.features[i],
202 ))
203 ) {
204 requireReloadMessage = 'Changing cargo features requires a reload';
205 }
206 this.prevCargoFeatures = { ...this.cargoFeatures };
207
208 if (requireReloadMessage !== null) {
209 const reloadAction = 'Reload now';
210 vscode.window
211 .showInformationMessage(requireReloadMessage, reloadAction)
212 .then(selectedAction => {
213 if (selectedAction === reloadAction) {
214 vscode.commands.executeCommand(
215 'workbench.action.reloadWindow',
216 );
217 }
218 });
219 }
155 } 220 }
156} 221}
diff --git a/editors/code/src/events/change_active_text_editor.ts b/editors/code/src/events/change_active_text_editor.ts
index 64be56225..74b91bd48 100644
--- a/editors/code/src/events/change_active_text_editor.ts
+++ b/editors/code/src/events/change_active_text_editor.ts
@@ -3,7 +3,7 @@ import { TextDocumentIdentifier } from 'vscode-languageclient';
3 3
4import { 4import {
5 SyntaxTreeContentProvider, 5 SyntaxTreeContentProvider,
6 syntaxTreeUri 6 syntaxTreeUri,
7} from '../commands/syntaxTree'; 7} from '../commands/syntaxTree';
8import { Decoration } from '../highlighting'; 8import { Decoration } from '../highlighting';
9import { Server } from '../server'; 9import { Server } from '../server';
@@ -21,11 +21,11 @@ export function makeHandler(syntaxTreeProvider: SyntaxTreeContentProvider) {
21 } 21 }
22 22
23 const params: TextDocumentIdentifier = { 23 const params: TextDocumentIdentifier = {
24 uri: editor.document.uri.toString() 24 uri: editor.document.uri.toString(),
25 }; 25 };
26 const decorations = await Server.client.sendRequest<Decoration[]>( 26 const decorations = await Server.client.sendRequest<Decoration[]>(
27 'rust-analyzer/decorationsRequest', 27 'rust-analyzer/decorationsRequest',
28 params 28 params,
29 ); 29 );
30 Server.highlighter.setHighlights(editor, decorations); 30 Server.highlighter.setHighlights(editor, decorations);
31 }; 31 };
diff --git a/editors/code/src/events/change_text_document.ts b/editors/code/src/events/change_text_document.ts
index 89488bc61..2e998e889 100644
--- a/editors/code/src/events/change_text_document.ts
+++ b/editors/code/src/events/change_text_document.ts
@@ -2,7 +2,7 @@ import * as vscode from 'vscode';
2 2
3import { 3import {
4 SyntaxTreeContentProvider, 4 SyntaxTreeContentProvider,
5 syntaxTreeUri 5 syntaxTreeUri,
6} from '../commands/syntaxTree'; 6} from '../commands/syntaxTree';
7 7
8export function createHandler(syntaxTreeProvider: SyntaxTreeContentProvider) { 8export function createHandler(syntaxTreeProvider: SyntaxTreeContentProvider) {
diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts
index 683497dfd..815f3692c 100644
--- a/editors/code/src/extension.ts
+++ b/editors/code/src/extension.ts
@@ -7,14 +7,14 @@ import { ExpandMacroContentProvider } from './commands/expand_macro';
7import { HintsUpdater } from './commands/inlay_hints'; 7import { HintsUpdater } from './commands/inlay_hints';
8import { 8import {
9 interactivelyStartCargoWatch, 9 interactivelyStartCargoWatch,
10 startCargoWatch 10 startCargoWatch,
11} from './commands/runnables'; 11} from './commands/runnables';
12import { SyntaxTreeContentProvider } from './commands/syntaxTree'; 12import { SyntaxTreeContentProvider } from './commands/syntaxTree';
13import * as events from './events'; 13import * as events from './events';
14import * as notifications from './notifications'; 14import * as notifications from './notifications';
15import { Server } from './server'; 15import { Server } from './server';
16 16
17export function activate(context: vscode.ExtensionContext) { 17export async function activate(context: vscode.ExtensionContext) {
18 function disposeOnDeactivation(disposable: vscode.Disposable) { 18 function disposeOnDeactivation(disposable: vscode.Disposable) {
19 context.subscriptions.push(disposable); 19 context.subscriptions.push(disposable);
20 } 20 }
@@ -24,7 +24,7 @@ export function activate(context: vscode.ExtensionContext) {
24 } 24 }
25 function overrideCommand( 25 function overrideCommand(
26 name: string, 26 name: string,
27 f: (...args: any[]) => Promise<boolean> 27 f: (...args: any[]) => Promise<boolean>,
28 ) { 28 ) {
29 const defaultCmd = `default:${name}`; 29 const defaultCmd = `default:${name}`;
30 const original = (...args: any[]) => 30 const original = (...args: any[]) =>
@@ -46,7 +46,7 @@ export function activate(context: vscode.ExtensionContext) {
46 }); 46 });
47 } catch (_) { 47 } catch (_) {
48 vscode.window.showWarningMessage( 48 vscode.window.showWarningMessage(
49 'Enhanced typing feature is disabled because of incompatibility with VIM extension, consider turning off rust-analyzer.enableEnhancedTyping: https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/README.md#settings' 49 'Enhanced typing feature is disabled because of incompatibility with VIM extension, consider turning off rust-analyzer.enableEnhancedTyping: https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/README.md#settings',
50 ); 50 );
51 } 51 }
52 } 52 }
@@ -54,14 +54,14 @@ export function activate(context: vscode.ExtensionContext) {
54 // Commands are requests from vscode to the language server 54 // Commands are requests from vscode to the language server
55 registerCommand( 55 registerCommand(
56 'rust-analyzer.analyzerStatus', 56 'rust-analyzer.analyzerStatus',
57 commands.analyzerStatus.makeCommand(context) 57 commands.analyzerStatus.makeCommand(context),
58 ); 58 );
59 registerCommand('rust-analyzer.collectGarbage', () => 59 registerCommand('rust-analyzer.collectGarbage', () =>
60 Server.client.sendRequest<null>('rust-analyzer/collectGarbage', null) 60 Server.client.sendRequest<null>('rust-analyzer/collectGarbage', null),
61 ); 61 );
62 registerCommand( 62 registerCommand(
63 'rust-analyzer.matchingBrace', 63 'rust-analyzer.matchingBrace',
64 commands.matchingBrace.handle 64 commands.matchingBrace.handle,
65 ); 65 );
66 registerCommand('rust-analyzer.joinLines', commands.joinLines.handle); 66 registerCommand('rust-analyzer.joinLines', commands.joinLines.handle);
67 registerCommand('rust-analyzer.parentModule', commands.parentModule.handle); 67 registerCommand('rust-analyzer.parentModule', commands.parentModule.handle);
@@ -70,7 +70,7 @@ export function activate(context: vscode.ExtensionContext) {
70 registerCommand('rust-analyzer.runSingle', commands.runnables.handleSingle); 70 registerCommand('rust-analyzer.runSingle', commands.runnables.handleSingle);
71 registerCommand( 71 registerCommand(
72 'rust-analyzer.applySourceChange', 72 'rust-analyzer.applySourceChange',
73 commands.applySourceChange.handle 73 commands.applySourceChange.handle,
74 ); 74 );
75 registerCommand( 75 registerCommand(
76 'rust-analyzer.showReferences', 76 'rust-analyzer.showReferences',
@@ -79,9 +79,9 @@ export function activate(context: vscode.ExtensionContext) {
79 'editor.action.showReferences', 79 'editor.action.showReferences',
80 vscode.Uri.parse(uri), 80 vscode.Uri.parse(uri),
81 Server.client.protocol2CodeConverter.asPosition(position), 81 Server.client.protocol2CodeConverter.asPosition(position),
82 locations.map(Server.client.protocol2CodeConverter.asLocation) 82 locations.map(Server.client.protocol2CodeConverter.asLocation),
83 ); 83 );
84 } 84 },
85 ); 85 );
86 86
87 if (Server.config.enableEnhancedTyping) { 87 if (Server.config.enableEnhancedTyping) {
@@ -89,48 +89,49 @@ export function activate(context: vscode.ExtensionContext) {
89 } 89 }
90 90
91 // Notifications are events triggered by the language server 91 // Notifications are events triggered by the language server
92 const allNotifications: Iterable< 92 const allNotifications: Iterable<[
93 [string, lc.GenericNotificationHandler] 93 string,
94 > = [ 94 lc.GenericNotificationHandler,
95 ]> = [
95 [ 96 [
96 'rust-analyzer/publishDecorations', 97 'rust-analyzer/publishDecorations',
97 notifications.publishDecorations.handle 98 notifications.publishDecorations.handle,
98 ] 99 ],
99 ]; 100 ];
100 const syntaxTreeContentProvider = new SyntaxTreeContentProvider(); 101 const syntaxTreeContentProvider = new SyntaxTreeContentProvider();
101 const expandMacroContentProvider = new ExpandMacroContentProvider(); 102 const expandMacroContentProvider = new ExpandMacroContentProvider();
102 103
103 // The events below are plain old javascript events, triggered and handled by vscode 104 // The events below are plain old javascript events, triggered and handled by vscode
104 vscode.window.onDidChangeActiveTextEditor( 105 vscode.window.onDidChangeActiveTextEditor(
105 events.changeActiveTextEditor.makeHandler(syntaxTreeContentProvider) 106 events.changeActiveTextEditor.makeHandler(syntaxTreeContentProvider),
106 ); 107 );
107 108
108 disposeOnDeactivation( 109 disposeOnDeactivation(
109 vscode.workspace.registerTextDocumentContentProvider( 110 vscode.workspace.registerTextDocumentContentProvider(
110 'rust-analyzer', 111 'rust-analyzer',
111 syntaxTreeContentProvider 112 syntaxTreeContentProvider,
112 ) 113 ),
113 ); 114 );
114 disposeOnDeactivation( 115 disposeOnDeactivation(
115 vscode.workspace.registerTextDocumentContentProvider( 116 vscode.workspace.registerTextDocumentContentProvider(
116 'rust-analyzer', 117 'rust-analyzer',
117 expandMacroContentProvider 118 expandMacroContentProvider,
118 ) 119 ),
119 ); 120 );
120 121
121 registerCommand( 122 registerCommand(
122 'rust-analyzer.syntaxTree', 123 'rust-analyzer.syntaxTree',
123 commands.syntaxTree.createHandle(syntaxTreeContentProvider) 124 commands.syntaxTree.createHandle(syntaxTreeContentProvider),
124 ); 125 );
125 registerCommand( 126 registerCommand(
126 'rust-analyzer.expandMacro', 127 'rust-analyzer.expandMacro',
127 commands.expandMacro.createHandle(expandMacroContentProvider) 128 commands.expandMacro.createHandle(expandMacroContentProvider),
128 ); 129 );
129 130
130 vscode.workspace.onDidChangeTextDocument( 131 vscode.workspace.onDidChangeTextDocument(
131 events.changeTextDocument.createHandler(syntaxTreeContentProvider), 132 events.changeTextDocument.createHandler(syntaxTreeContentProvider),
132 null, 133 null,
133 context.subscriptions 134 context.subscriptions,
134 ); 135 );
135 136
136 const startServer = () => Server.start(allNotifications); 137 const startServer = () => Server.start(allNotifications);
@@ -159,7 +160,11 @@ export function activate(context: vscode.ExtensionContext) {
159 }); 160 });
160 161
161 // Start the language server, finally! 162 // Start the language server, finally!
162 startServer(); 163 try {
164 await startServer();
165 } catch (e) {
166 vscode.window.showErrorMessage(e.message);
167 }
163 168
164 if (Server.config.displayInlayHints) { 169 if (Server.config.displayInlayHints) {
165 const hintsUpdater = new HintsUpdater(); 170 const hintsUpdater = new HintsUpdater();
@@ -173,25 +178,25 @@ export function activate(context: vscode.ExtensionContext) {
173 editorChangeDisposable.dispose(); 178 editorChangeDisposable.dispose();
174 } 179 }
175 return hintsUpdater.refreshHintsForVisibleEditors(); 180 return hintsUpdater.refreshHintsForVisibleEditors();
176 } 181 },
177 ); 182 );
178 183
179 disposeOnDeactivation( 184 disposeOnDeactivation(
180 vscode.window.onDidChangeVisibleTextEditors(_ => 185 vscode.window.onDidChangeVisibleTextEditors(_ =>
181 hintsUpdater.refreshHintsForVisibleEditors() 186 hintsUpdater.refreshHintsForVisibleEditors(),
182 ) 187 ),
183 ); 188 );
184 disposeOnDeactivation( 189 disposeOnDeactivation(
185 vscode.workspace.onDidChangeTextDocument(e => 190 vscode.workspace.onDidChangeTextDocument(e =>
186 hintsUpdater.refreshHintsForVisibleEditors(e) 191 hintsUpdater.refreshHintsForVisibleEditors(e),
187 ) 192 ),
188 ); 193 );
189 disposeOnDeactivation( 194 disposeOnDeactivation(
190 vscode.workspace.onDidChangeConfiguration(_ => 195 vscode.workspace.onDidChangeConfiguration(_ =>
191 hintsUpdater.toggleHintsDisplay( 196 hintsUpdater.toggleHintsDisplay(
192 Server.config.displayInlayHints 197 Server.config.displayInlayHints,
193 ) 198 ),
194 ) 199 ),
195 ); 200 );
196 }); 201 });
197 } 202 }
@@ -204,10 +209,10 @@ export function deactivate(): Thenable<void> {
204 return Server.client.stop(); 209 return Server.client.stop();
205} 210}
206 211
207async function reloadServer(startServer: () => void) { 212async function reloadServer(startServer: () => Promise<void>) {
208 if (Server.client != null) { 213 if (Server.client != null) {
209 vscode.window.showInformationMessage('Reloading rust-analyzer...'); 214 vscode.window.showInformationMessage('Reloading rust-analyzer...');
210 await Server.client.stop(); 215 await Server.client.stop();
211 startServer(); 216 await startServer();
212 } 217 }
213} 218}
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts
index 0a38c9ef6..68eae0941 100644
--- a/editors/code/src/highlighting.ts
+++ b/editors/code/src/highlighting.ts
@@ -67,7 +67,7 @@ export class Highlighter {
67 > { 67 > {
68 const decoration = ( 68 const decoration = (
69 tag: string, 69 tag: string,
70 textDecoration?: string 70 textDecoration?: string,
71 ): [string, vscode.TextEditorDecorationType] => { 71 ): [string, vscode.TextEditorDecorationType] => {
72 const rule = scopesMapper.toRule(tag, scopes.find); 72 const rule = scopesMapper.toRule(tag, scopes.find);
73 73
@@ -90,9 +90,10 @@ export class Highlighter {
90 } 90 }
91 }; 91 };
92 92
93 const decorations: Iterable< 93 const decorations: Iterable<[
94 [string, vscode.TextEditorDecorationType] 94 string,
95 > = [ 95 vscode.TextEditorDecorationType,
96 ]> = [
96 decoration('comment'), 97 decoration('comment'),
97 decoration('string'), 98 decoration('string'),
98 decoration('keyword'), 99 decoration('keyword'),
@@ -101,16 +102,23 @@ export class Highlighter {
101 decoration('function'), 102 decoration('function'),
102 decoration('parameter'), 103 decoration('parameter'),
103 decoration('constant'), 104 decoration('constant'),
105 decoration('type.builtin'),
106 decoration('type.generic'),
107 decoration('type.lifetime'),
108 decoration('type.param'),
109 decoration('type.self'),
104 decoration('type'), 110 decoration('type'),
105 decoration('builtin'),
106 decoration('text'), 111 decoration('text'),
107 decoration('attribute'), 112 decoration('attribute'),
108 decoration('literal'), 113 decoration('literal'),
114 decoration('literal.numeric'),
115 decoration('literal.char'),
116 decoration('literal.byte'),
109 decoration('macro'), 117 decoration('macro'),
110 decoration('variable'), 118 decoration('variable'),
111 decoration('variable.mut', 'underline'), 119 decoration('variable.mut', 'underline'),
112 decoration('field'), 120 decoration('field'),
113 decoration('module') 121 decoration('module'),
114 ]; 122 ];
115 123
116 return new Map<string, vscode.TextEditorDecorationType>(decorations); 124 return new Map<string, vscode.TextEditorDecorationType>(decorations);
@@ -139,7 +147,6 @@ export class Highlighter {
139 // 147 //
140 // Note: decoration objects need to be kept around so we can dispose them 148 // Note: decoration objects need to be kept around so we can dispose them
141 // if the user disables syntax highlighting 149 // if the user disables syntax highlighting
142
143 if (this.decorations == null) { 150 if (this.decorations == null) {
144 this.decorations = Highlighter.initDecorations(); 151 this.decorations = Highlighter.initDecorations();
145 } 152 }
@@ -168,23 +175,22 @@ export class Highlighter {
168 colorfulIdents 175 colorfulIdents
169 .get(d.bindingHash)![0] 176 .get(d.bindingHash)![0]
170 .push( 177 .push(
171 Server.client.protocol2CodeConverter.asRange(d.range) 178 Server.client.protocol2CodeConverter.asRange(d.range),
172 ); 179 );
173 } else { 180 } else {
174 byTag 181 byTag
175 .get(d.tag)! 182 .get(d.tag)!
176 .push( 183 .push(
177 Server.client.protocol2CodeConverter.asRange(d.range) 184 Server.client.protocol2CodeConverter.asRange(d.range),
178 ); 185 );
179 } 186 }
180 } 187 }
181 188
182 for (const tag of byTag.keys()) { 189 for (const tag of byTag.keys()) {
183 const dec = this.decorations.get( 190 const dec = this.decorations.get(
184 tag 191 tag,
185 ) as vscode.TextEditorDecorationType; 192 ) as vscode.TextEditorDecorationType;
186 const ranges = byTag.get(tag)!; 193 const ranges = byTag.get(tag)!;
187
188 editor.setDecorations(dec, ranges); 194 editor.setDecorations(dec, ranges);
189 } 195 }
190 196
@@ -192,7 +198,7 @@ export class Highlighter {
192 const textDecoration = mut ? 'underline' : undefined; 198 const textDecoration = mut ? 'underline' : undefined;
193 const dec = vscode.window.createTextEditorDecorationType({ 199 const dec = vscode.window.createTextEditorDecorationType({
194 light: { color: fancify(hash, 'light'), textDecoration }, 200 light: { color: fancify(hash, 'light'), textDecoration },
195 dark: { color: fancify(hash, 'dark'), textDecoration } 201 dark: { color: fancify(hash, 'dark'), textDecoration },
196 }); 202 });
197 editor.setDecorations(dec, ranges); 203 editor.setDecorations(dec, ranges);
198 } 204 }
diff --git a/editors/code/src/notifications/publish_decorations.ts b/editors/code/src/notifications/publish_decorations.ts
index 3180019b7..f23e286ad 100644
--- a/editors/code/src/notifications/publish_decorations.ts
+++ b/editors/code/src/notifications/publish_decorations.ts
@@ -9,11 +9,16 @@ export interface PublishDecorationsParams {
9} 9}
10 10
11export function handle(params: PublishDecorationsParams) { 11export function handle(params: PublishDecorationsParams) {
12 const targetEditor = vscode.window.visibleTextEditors.find( 12 const targetEditor = vscode.window.visibleTextEditors.find(editor => {
13 editor => editor.document.uri.toString() === params.uri 13 const unescapedUri = unescape(editor.document.uri.toString());
14 ); 14 // Unescaped URI looks like:
15 // file:///c:/Workspace/ra-test/src/main.rs
16 return unescapedUri === params.uri;
17 });
18
15 if (!Server.config.highlightingOn || !targetEditor) { 19 if (!Server.config.highlightingOn || !targetEditor) {
16 return; 20 return;
17 } 21 }
22
18 Server.highlighter.setHighlights(targetEditor, params.decorations); 23 Server.highlighter.setHighlights(targetEditor, params.decorations);
19} 24}
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts
index 7907b70bc..5ace1d0fa 100644
--- a/editors/code/src/server.ts
+++ b/editors/code/src/server.ts
@@ -1,4 +1,5 @@
1import { homedir } from 'os'; 1import { lookpath } from 'lookpath';
2import { homedir, platform } from 'os';
2import * as lc from 'vscode-languageclient'; 3import * as lc from 'vscode-languageclient';
3 4
4import { window, workspace } from 'vscode'; 5import { window, workspace } from 'vscode';
@@ -17,8 +18,8 @@ export class Server {
17 public static config = new Config(); 18 public static config = new Config();
18 public static client: lc.LanguageClient; 19 public static client: lc.LanguageClient;
19 20
20 public static start( 21 public static async start(
21 notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]> 22 notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]>,
22 ) { 23 ) {
23 // '.' Is the fallback if no folder is open 24 // '.' Is the fallback if no folder is open
24 // TODO?: Workspace folders support Uri's (eg: file://test.txt). It might be a good idea to test if the uri points to a file. 25 // TODO?: Workspace folders support Uri's (eg: file://test.txt). It might be a good idea to test if the uri points to a file.
@@ -27,16 +28,26 @@ export class Server {
27 folder = workspace.workspaceFolders[0].uri.fsPath.toString(); 28 folder = workspace.workspaceFolders[0].uri.fsPath.toString();
28 } 29 }
29 30
31 const command = expandPathResolving(this.config.raLspServerPath);
32 // FIXME: remove check when the following issue is fixed:
33 // https://github.com/otiai10/lookpath/issues/4
34 if (platform() !== 'win32') {
35 if (!(await lookpath(command))) {
36 throw new Error(
37 `Cannot find rust-analyzer server \`${command}\` in PATH.`,
38 );
39 }
40 }
30 const run: lc.Executable = { 41 const run: lc.Executable = {
31 command: expandPathResolving(this.config.raLspServerPath), 42 command,
32 options: { cwd: folder } 43 options: { cwd: folder },
33 }; 44 };
34 const serverOptions: lc.ServerOptions = { 45 const serverOptions: lc.ServerOptions = {
35 run, 46 run,
36 debug: run 47 debug: run,
37 }; 48 };
38 const traceOutputChannel = window.createOutputChannel( 49 const traceOutputChannel = window.createOutputChannel(
39 'Rust Analyzer Language Server Trace' 50 'Rust Analyzer Language Server Trace',
40 ); 51 );
41 const clientOptions: lc.LanguageClientOptions = { 52 const clientOptions: lc.LanguageClientOptions = {
42 documentSelector: [{ scheme: 'file', language: 'rust' }], 53 documentSelector: [{ scheme: 'file', language: 'rust' }],
@@ -46,16 +57,18 @@ export class Server {
46 maxInlayHintLength: Server.config.maxInlayHintLength, 57 maxInlayHintLength: Server.config.maxInlayHintLength,
47 excludeGlobs: Server.config.excludeGlobs, 58 excludeGlobs: Server.config.excludeGlobs,
48 useClientWatching: Server.config.useClientWatching, 59 useClientWatching: Server.config.useClientWatching,
49 featureFlags: Server.config.featureFlags 60 featureFlags: Server.config.featureFlags,
61 withSysroot: Server.config.withSysroot,
62 cargoFeatures: Server.config.cargoFeatures,
50 }, 63 },
51 traceOutputChannel 64 traceOutputChannel,
52 }; 65 };
53 66
54 Server.client = new lc.LanguageClient( 67 Server.client = new lc.LanguageClient(
55 'rust-analyzer', 68 'rust-analyzer',
56 'Rust Analyzer Language Server', 69 'Rust Analyzer Language Server',
57 serverOptions, 70 serverOptions,
58 clientOptions 71 clientOptions,
59 ); 72 );
60 // HACK: This is an awful way of filtering out the decorations notifications 73 // HACK: This is an awful way of filtering out the decorations notifications
61 // However, pending proper support, this is the most effecitve approach 74 // However, pending proper support, this is the most effecitve approach
@@ -68,10 +81,10 @@ export class Server {
68 if (typeof messageOrDataObject === 'string') { 81 if (typeof messageOrDataObject === 'string') {
69 if ( 82 if (
70 messageOrDataObject.includes( 83 messageOrDataObject.includes(
71 'rust-analyzer/publishDecorations' 84 'rust-analyzer/publishDecorations',
72 ) || 85 ) ||
73 messageOrDataObject.includes( 86 messageOrDataObject.includes(
74 'rust-analyzer/decorationsRequest' 87 'rust-analyzer/decorationsRequest',
75 ) 88 )
76 ) { 89 ) {
77 // Don't log publish decorations requests 90 // Don't log publish decorations requests
@@ -83,7 +96,7 @@ export class Server {
83 // @ts-ignore 96 // @ts-ignore
84 Server.client.logObjectTrace(messageOrDataObject); 97 Server.client.logObjectTrace(messageOrDataObject);
85 } 98 }
86 } 99 },
87 }; 100 };
88 Server.client.registerProposedFeatures(); 101 Server.client.registerProposedFeatures();
89 Server.client.onReady().then(() => { 102 Server.client.onReady().then(() => {
diff --git a/editors/code/src/test/fixtures/rust-diagnostics/error/E0277.json b/editors/code/src/test/fixtures/rust-diagnostics/error/E0277.json
new file mode 100644
index 000000000..bfef33c7d
--- /dev/null
+++ b/editors/code/src/test/fixtures/rust-diagnostics/error/E0277.json
@@ -0,0 +1,261 @@
1{
2 "rendered": "error[E0277]: can't compare `{integer}` with `&str`\n --> src/main.rs:2:5\n |\n2 | assert_eq!(1, \"love\");\n | ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `{integer} == &str`\n |\n = help: the trait `std::cmp::PartialEq<&str>` is not implemented for `{integer}`\n = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)\n\n",
3 "children": [
4 {
5 "children": [],
6 "code": null,
7 "level": "help",
8 "message": "the trait `std::cmp::PartialEq<&str>` is not implemented for `{integer}`",
9 "rendered": null,
10 "spans": []
11 }
12 ],
13 "code": {
14 "code": "E0277",
15 "explanation": "\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n foo.bar();\n}\n\nfn main() {\n // we now call the method with the i32 type, which doesn't implement\n // the Foo trait\n some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n foo.bar(); // we can now use this method since i32 implements the\n // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n fn bar(&self) {}\n}\n\nfn main() {\n some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n // implemented for the type `T`\n}\n\nfn main() {\n // We now call the method with the i32 type,\n // which *does* implement the Debug trait.\n some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n println!(\"{:?}\", foo);\n}\n\nfn main() {\n // Calling the method is still fine, as i32 implements Debug.\n some_func(5i32);\n\n // This would fail to compile now:\n // struct WithoutDebug;\n // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n"
16 },
17 "level": "error",
18 "message": "can't compare `{integer}` with `&str`",
19 "spans": [
20 {
21 "byte_end": 155,
22 "byte_start": 153,
23 "column_end": 33,
24 "column_start": 31,
25 "expansion": {
26 "def_site_span": {
27 "byte_end": 940,
28 "byte_start": 0,
29 "column_end": 6,
30 "column_start": 1,
31 "expansion": null,
32 "file_name": "<::core::macros::assert_eq macros>",
33 "is_primary": false,
34 "label": null,
35 "line_end": 36,
36 "line_start": 1,
37 "suggested_replacement": null,
38 "suggestion_applicability": null,
39 "text": [
40 {
41 "highlight_end": 35,
42 "highlight_start": 1,
43 "text": "($ left : expr, $ right : expr) =>"
44 },
45 {
46 "highlight_end": 3,
47 "highlight_start": 1,
48 "text": "({"
49 },
50 {
51 "highlight_end": 33,
52 "highlight_start": 1,
53 "text": " match (& $ left, & $ right)"
54 },
55 {
56 "highlight_end": 7,
57 "highlight_start": 1,
58 "text": " {"
59 },
60 {
61 "highlight_end": 34,
62 "highlight_start": 1,
63 "text": " (left_val, right_val) =>"
64 },
65 {
66 "highlight_end": 11,
67 "highlight_start": 1,
68 "text": " {"
69 },
70 {
71 "highlight_end": 46,
72 "highlight_start": 1,
73 "text": " if ! (* left_val == * right_val)"
74 },
75 {
76 "highlight_end": 15,
77 "highlight_start": 1,
78 "text": " {"
79 },
80 {
81 "highlight_end": 25,
82 "highlight_start": 1,
83 "text": " panic !"
84 },
85 {
86 "highlight_end": 57,
87 "highlight_start": 1,
88 "text": " (r#\"assertion failed: `(left == right)`"
89 },
90 {
91 "highlight_end": 16,
92 "highlight_start": 1,
93 "text": " left: `{:?}`,"
94 },
95 {
96 "highlight_end": 18,
97 "highlight_start": 1,
98 "text": " right: `{:?}`\"#,"
99 },
100 {
101 "highlight_end": 47,
102 "highlight_start": 1,
103 "text": " & * left_val, & * right_val)"
104 },
105 {
106 "highlight_end": 15,
107 "highlight_start": 1,
108 "text": " }"
109 },
110 {
111 "highlight_end": 11,
112 "highlight_start": 1,
113 "text": " }"
114 },
115 {
116 "highlight_end": 7,
117 "highlight_start": 1,
118 "text": " }"
119 },
120 {
121 "highlight_end": 42,
122 "highlight_start": 1,
123 "text": " }) ; ($ left : expr, $ right : expr,) =>"
124 },
125 {
126 "highlight_end": 49,
127 "highlight_start": 1,
128 "text": "({ $ crate :: assert_eq ! ($ left, $ right) }) ;"
129 },
130 {
131 "highlight_end": 53,
132 "highlight_start": 1,
133 "text": "($ left : expr, $ right : expr, $ ($ arg : tt) +) =>"
134 },
135 {
136 "highlight_end": 3,
137 "highlight_start": 1,
138 "text": "({"
139 },
140 {
141 "highlight_end": 37,
142 "highlight_start": 1,
143 "text": " match (& ($ left), & ($ right))"
144 },
145 {
146 "highlight_end": 7,
147 "highlight_start": 1,
148 "text": " {"
149 },
150 {
151 "highlight_end": 34,
152 "highlight_start": 1,
153 "text": " (left_val, right_val) =>"
154 },
155 {
156 "highlight_end": 11,
157 "highlight_start": 1,
158 "text": " {"
159 },
160 {
161 "highlight_end": 46,
162 "highlight_start": 1,
163 "text": " if ! (* left_val == * right_val)"
164 },
165 {
166 "highlight_end": 15,
167 "highlight_start": 1,
168 "text": " {"
169 },
170 {
171 "highlight_end": 25,
172 "highlight_start": 1,
173 "text": " panic !"
174 },
175 {
176 "highlight_end": 57,
177 "highlight_start": 1,
178 "text": " (r#\"assertion failed: `(left == right)`"
179 },
180 {
181 "highlight_end": 16,
182 "highlight_start": 1,
183 "text": " left: `{:?}`,"
184 },
185 {
186 "highlight_end": 22,
187 "highlight_start": 1,
188 "text": " right: `{:?}`: {}\"#,"
189 },
190 {
191 "highlight_end": 72,
192 "highlight_start": 1,
193 "text": " & * left_val, & * right_val, $ crate :: format_args !"
194 },
195 {
196 "highlight_end": 33,
197 "highlight_start": 1,
198 "text": " ($ ($ arg) +))"
199 },
200 {
201 "highlight_end": 15,
202 "highlight_start": 1,
203 "text": " }"
204 },
205 {
206 "highlight_end": 11,
207 "highlight_start": 1,
208 "text": " }"
209 },
210 {
211 "highlight_end": 7,
212 "highlight_start": 1,
213 "text": " }"
214 },
215 {
216 "highlight_end": 6,
217 "highlight_start": 1,
218 "text": " }) ;"
219 }
220 ]
221 },
222 "macro_decl_name": "assert_eq!",
223 "span": {
224 "byte_end": 38,
225 "byte_start": 16,
226 "column_end": 27,
227 "column_start": 5,
228 "expansion": null,
229 "file_name": "src/main.rs",
230 "is_primary": false,
231 "label": null,
232 "line_end": 2,
233 "line_start": 2,
234 "suggested_replacement": null,
235 "suggestion_applicability": null,
236 "text": [
237 {
238 "highlight_end": 27,
239 "highlight_start": 5,
240 "text": " assert_eq!(1, \"love\");"
241 }
242 ]
243 }
244 },
245 "file_name": "<::core::macros::assert_eq macros>",
246 "is_primary": true,
247 "label": "no implementation for `{integer} == &str`",
248 "line_end": 7,
249 "line_start": 7,
250 "suggested_replacement": null,
251 "suggestion_applicability": null,
252 "text": [
253 {
254 "highlight_end": 33,
255 "highlight_start": 31,
256 "text": " if ! (* left_val == * right_val)"
257 }
258 ]
259 }
260 ]
261}
diff --git a/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts b/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts
index 6c7f436f3..2b25eb705 100644
--- a/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts
+++ b/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts
@@ -6,12 +6,12 @@ import SuggestedFix from '../../../utils/diagnostics/SuggestedFix';
6 6
7const location1 = new vscode.Location( 7const location1 = new vscode.Location(
8 vscode.Uri.file('/file/1'), 8 vscode.Uri.file('/file/1'),
9 new vscode.Range(new vscode.Position(1, 2), new vscode.Position(3, 4)) 9 new vscode.Range(new vscode.Position(1, 2), new vscode.Position(3, 4)),
10); 10);
11 11
12const location2 = new vscode.Location( 12const location2 = new vscode.Location(
13 vscode.Uri.file('/file/2'), 13 vscode.Uri.file('/file/2'),
14 new vscode.Range(new vscode.Position(5, 6), new vscode.Position(7, 8)) 14 new vscode.Range(new vscode.Position(5, 6), new vscode.Position(7, 8)),
15); 15);
16 16
17describe('SuggestedFix', () => { 17describe('SuggestedFix', () => {
@@ -20,13 +20,13 @@ describe('SuggestedFix', () => {
20 const suggestion1 = new SuggestedFix( 20 const suggestion1 = new SuggestedFix(
21 'Replace me!', 21 'Replace me!',
22 location1, 22 location1,
23 'With this!' 23 'With this!',
24 ); 24 );
25 25
26 const suggestion2 = new SuggestedFix( 26 const suggestion2 = new SuggestedFix(
27 'Replace me!', 27 'Replace me!',
28 location1, 28 location1,
29 'With this!' 29 'With this!',
30 ); 30 );
31 31
32 assert(suggestion1.isEqual(suggestion2)); 32 assert(suggestion1.isEqual(suggestion2));
@@ -36,13 +36,13 @@ describe('SuggestedFix', () => {
36 const suggestion1 = new SuggestedFix( 36 const suggestion1 = new SuggestedFix(
37 'Replace me!', 37 'Replace me!',
38 location1, 38 location1,
39 'With this!' 39 'With this!',
40 ); 40 );
41 41
42 const suggestion2 = new SuggestedFix( 42 const suggestion2 = new SuggestedFix(
43 'Not the same title!', 43 'Not the same title!',
44 location1, 44 location1,
45 'With this!' 45 'With this!',
46 ); 46 );
47 47
48 assert(!suggestion1.isEqual(suggestion2)); 48 assert(!suggestion1.isEqual(suggestion2));
@@ -52,13 +52,13 @@ describe('SuggestedFix', () => {
52 const suggestion1 = new SuggestedFix( 52 const suggestion1 = new SuggestedFix(
53 'Replace me!', 53 'Replace me!',
54 location1, 54 location1,
55 'With this!' 55 'With this!',
56 ); 56 );
57 57
58 const suggestion2 = new SuggestedFix( 58 const suggestion2 = new SuggestedFix(
59 'Replace me!', 59 'Replace me!',
60 location1, 60 location1,
61 'With something else!' 61 'With something else!',
62 ); 62 );
63 63
64 assert(!suggestion1.isEqual(suggestion2)); 64 assert(!suggestion1.isEqual(suggestion2));
@@ -68,13 +68,13 @@ describe('SuggestedFix', () => {
68 const suggestion1 = new SuggestedFix( 68 const suggestion1 = new SuggestedFix(
69 'Replace me!', 69 'Replace me!',
70 location1, 70 location1,
71 'With this!' 71 'With this!',
72 ); 72 );
73 73
74 const suggestion2 = new SuggestedFix( 74 const suggestion2 = new SuggestedFix(
75 'Replace me!', 75 'Replace me!',
76 location2, 76 location2,
77 'With this!' 77 'With this!',
78 ); 78 );
79 79
80 assert(!suggestion1.isEqual(suggestion2)); 80 assert(!suggestion1.isEqual(suggestion2));
@@ -85,14 +85,14 @@ describe('SuggestedFix', () => {
85 'Replace me!', 85 'Replace me!',
86 location1, 86 location1,
87 'With this!', 87 'With this!',
88 SuggestionApplicability.MachineApplicable 88 SuggestionApplicability.MachineApplicable,
89 ); 89 );
90 90
91 const suggestion2 = new SuggestedFix( 91 const suggestion2 = new SuggestedFix(
92 'Replace me!', 92 'Replace me!',
93 location2, 93 location2,
94 'With this!', 94 'With this!',
95 SuggestionApplicability.HasPlaceholders 95 SuggestionApplicability.HasPlaceholders,
96 ); 96 );
97 97
98 assert(!suggestion1.isEqual(suggestion2)); 98 assert(!suggestion1.isEqual(suggestion2));
@@ -104,7 +104,7 @@ describe('SuggestedFix', () => {
104 const suggestion = new SuggestedFix( 104 const suggestion = new SuggestedFix(
105 'Replace me!', 105 'Replace me!',
106 location1, 106 location1,
107 'With this!' 107 'With this!',
108 ); 108 );
109 109
110 const codeAction = suggestion.toCodeAction(); 110 const codeAction = suggestion.toCodeAction();
@@ -114,7 +114,8 @@ describe('SuggestedFix', () => {
114 114
115 const edit = codeAction.edit; 115 const edit = codeAction.edit;
116 if (!edit) { 116 if (!edit) {
117 return assert.fail('Code Action edit unexpectedly missing'); 117 assert.fail('Code Action edit unexpectedly missing');
118 return;
118 } 119 }
119 120
120 const editEntries = edit.entries(); 121 const editEntries = edit.entries();
diff --git a/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts b/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts
index f0328893e..ef09013f4 100644
--- a/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts
+++ b/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts
@@ -8,20 +8,20 @@ const uri1 = vscode.Uri.file('/file/1');
8const uri2 = vscode.Uri.file('/file/2'); 8const uri2 = vscode.Uri.file('/file/2');
9 9
10const mockDocument1 = ({ 10const mockDocument1 = ({
11 uri: uri1 11 uri: uri1,
12} as unknown) as vscode.TextDocument; 12} as unknown) as vscode.TextDocument;
13 13
14const mockDocument2 = ({ 14const mockDocument2 = ({
15 uri: uri2 15 uri: uri2,
16} as unknown) as vscode.TextDocument; 16} as unknown) as vscode.TextDocument;
17 17
18const range1 = new vscode.Range( 18const range1 = new vscode.Range(
19 new vscode.Position(1, 2), 19 new vscode.Position(1, 2),
20 new vscode.Position(3, 4) 20 new vscode.Position(3, 4),
21); 21);
22const range2 = new vscode.Range( 22const range2 = new vscode.Range(
23 new vscode.Position(5, 6), 23 new vscode.Position(5, 6),
24 new vscode.Position(7, 8) 24 new vscode.Position(7, 8),
25); 25);
26 26
27const diagnostic1 = new vscode.Diagnostic(range1, 'First diagnostic'); 27const diagnostic1 = new vscode.Diagnostic(range1, 'First diagnostic');
@@ -32,7 +32,7 @@ function suggestion1(): SuggestedFix {
32 return new SuggestedFix( 32 return new SuggestedFix(
33 'Replace me!', 33 'Replace me!',
34 new vscode.Location(uri1, range1), 34 new vscode.Location(uri1, range1),
35 'With this!' 35 'With this!',
36 ); 36 );
37} 37}
38 38
@@ -44,7 +44,7 @@ describe('SuggestedFixCollection', () => {
44 // Specify the document and range that exactly matches 44 // Specify the document and range that exactly matches
45 const codeActions = suggestedFixes.provideCodeActions( 45 const codeActions = suggestedFixes.provideCodeActions(
46 mockDocument1, 46 mockDocument1,
47 range1 47 range1,
48 ); 48 );
49 49
50 assert.strictEqual(codeActions.length, 1); 50 assert.strictEqual(codeActions.length, 1);
@@ -53,7 +53,8 @@ describe('SuggestedFixCollection', () => {
53 53
54 const { diagnostics } = codeAction; 54 const { diagnostics } = codeAction;
55 if (!diagnostics) { 55 if (!diagnostics) {
56 return assert.fail('Diagnostics unexpectedly missing'); 56 assert.fail('Diagnostics unexpectedly missing');
57 return;
57 } 58 }
58 59
59 assert.strictEqual(diagnostics.length, 1); 60 assert.strictEqual(diagnostics.length, 1);
@@ -66,7 +67,7 @@ describe('SuggestedFixCollection', () => {
66 67
67 const codeActions = suggestedFixes.provideCodeActions( 68 const codeActions = suggestedFixes.provideCodeActions(
68 mockDocument1, 69 mockDocument1,
69 range2 70 range2,
70 ); 71 );
71 72
72 assert(!codeActions || codeActions.length === 0); 73 assert(!codeActions || codeActions.length === 0);
@@ -78,7 +79,7 @@ describe('SuggestedFixCollection', () => {
78 79
79 const codeActions = suggestedFixes.provideCodeActions( 80 const codeActions = suggestedFixes.provideCodeActions(
80 mockDocument2, 81 mockDocument2,
81 range1 82 range1,
82 ); 83 );
83 84
84 assert(!codeActions || codeActions.length === 0); 85 assert(!codeActions || codeActions.length === 0);
@@ -91,7 +92,7 @@ describe('SuggestedFixCollection', () => {
91 92
92 const codeActions = suggestedFixes.provideCodeActions( 93 const codeActions = suggestedFixes.provideCodeActions(
93 mockDocument1, 94 mockDocument1,
94 range1 95 range1,
95 ); 96 );
96 97
97 assert(!codeActions || codeActions.length === 0); 98 assert(!codeActions || codeActions.length === 0);
@@ -106,7 +107,7 @@ describe('SuggestedFixCollection', () => {
106 107
107 const codeActions = suggestedFixes.provideCodeActions( 108 const codeActions = suggestedFixes.provideCodeActions(
108 mockDocument1, 109 mockDocument1,
109 range1 110 range1,
110 ); 111 );
111 112
112 assert.strictEqual(codeActions.length, 1); 113 assert.strictEqual(codeActions.length, 1);
@@ -114,7 +115,8 @@ describe('SuggestedFixCollection', () => {
114 const { diagnostics } = codeAction; 115 const { diagnostics } = codeAction;
115 116
116 if (!diagnostics) { 117 if (!diagnostics) {
117 return assert.fail('Diagnostics unexpectedly missing'); 118 assert.fail('Diagnostics unexpectedly missing');
119 return;
118 } 120 }
119 121
120 // We should be associated with both diagnostics 122 // We should be associated with both diagnostics
diff --git a/editors/code/src/test/utils/diagnotics/rust.test.ts b/editors/code/src/test/utils/diagnotics/rust.test.ts
index 327d15046..358325cc8 100644
--- a/editors/code/src/test/utils/diagnotics/rust.test.ts
+++ b/editors/code/src/test/utils/diagnotics/rust.test.ts
@@ -6,14 +6,14 @@ import {
6 MappedRustDiagnostic, 6 MappedRustDiagnostic,
7 mapRustDiagnosticToVsCode, 7 mapRustDiagnosticToVsCode,
8 RustDiagnostic, 8 RustDiagnostic,
9 SuggestionApplicability 9 SuggestionApplicability,
10} from '../../../utils/diagnostics/rust'; 10} from '../../../utils/diagnostics/rust';
11 11
12function loadDiagnosticFixture(name: string): RustDiagnostic { 12function loadDiagnosticFixture(name: string): RustDiagnostic {
13 const jsonText = fs 13 const jsonText = fs
14 .readFileSync( 14 .readFileSync(
15 // We're actually in our JavaScript output directory, climb out 15 // We're actually in our JavaScript output directory, climb out
16 `${__dirname}/../../../../src/test/fixtures/rust-diagnostics/${name}.json` 16 `${__dirname}/../../../../src/test/fixtures/rust-diagnostics/${name}.json`,
17 ) 17 )
18 .toString(); 18 .toString();
19 19
@@ -33,12 +33,12 @@ function mapFixtureToVsCode(name: string): MappedRustDiagnostic {
33describe('mapRustDiagnosticToVsCode', () => { 33describe('mapRustDiagnosticToVsCode', () => {
34 it('should map an incompatible type for trait error', () => { 34 it('should map an incompatible type for trait error', () => {
35 const { diagnostic, suggestedFixes } = mapFixtureToVsCode( 35 const { diagnostic, suggestedFixes } = mapFixtureToVsCode(
36 'error/E0053' 36 'error/E0053',
37 ); 37 );
38 38
39 assert.strictEqual( 39 assert.strictEqual(
40 diagnostic.severity, 40 diagnostic.severity,
41 vscode.DiagnosticSeverity.Error 41 vscode.DiagnosticSeverity.Error,
42 ); 42 );
43 assert.strictEqual(diagnostic.source, 'rustc'); 43 assert.strictEqual(diagnostic.source, 'rustc');
44 assert.strictEqual( 44 assert.strictEqual(
@@ -46,8 +46,8 @@ describe('mapRustDiagnosticToVsCode', () => {
46 [ 46 [
47 `method \`next\` has an incompatible type for trait`, 47 `method \`next\` has an incompatible type for trait`,
48 `expected type \`fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref<M>>\``, 48 `expected type \`fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref<M>>\``,
49 ` found type \`fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref<M>>\`` 49 ` found type \`fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref<M>>\``,
50 ].join('\n') 50 ].join('\n'),
51 ); 51 );
52 assert.strictEqual(diagnostic.code, 'E0053'); 52 assert.strictEqual(diagnostic.code, 'E0053');
53 assert.deepStrictEqual(diagnostic.tags, []); 53 assert.deepStrictEqual(diagnostic.tags, []);
@@ -61,24 +61,24 @@ describe('mapRustDiagnosticToVsCode', () => {
61 61
62 it('should map an unused variable warning', () => { 62 it('should map an unused variable warning', () => {
63 const { diagnostic, suggestedFixes } = mapFixtureToVsCode( 63 const { diagnostic, suggestedFixes } = mapFixtureToVsCode(
64 'warning/unused_variables' 64 'warning/unused_variables',
65 ); 65 );
66 66
67 assert.strictEqual( 67 assert.strictEqual(
68 diagnostic.severity, 68 diagnostic.severity,
69 vscode.DiagnosticSeverity.Warning 69 vscode.DiagnosticSeverity.Warning,
70 ); 70 );
71 assert.strictEqual( 71 assert.strictEqual(
72 diagnostic.message, 72 diagnostic.message,
73 [ 73 [
74 'unused variable: `foo`', 74 'unused variable: `foo`',
75 '#[warn(unused_variables)] on by default' 75 '#[warn(unused_variables)] on by default',
76 ].join('\n') 76 ].join('\n'),
77 ); 77 );
78 assert.strictEqual(diagnostic.code, 'unused_variables'); 78 assert.strictEqual(diagnostic.code, 'unused_variables');
79 assert.strictEqual(diagnostic.source, 'rustc'); 79 assert.strictEqual(diagnostic.source, 'rustc');
80 assert.deepStrictEqual(diagnostic.tags, [ 80 assert.deepStrictEqual(diagnostic.tags, [
81 vscode.DiagnosticTag.Unnecessary 81 vscode.DiagnosticTag.Unnecessary,
82 ]); 82 ]);
83 83
84 // No related information 84 // No related information
@@ -89,29 +89,29 @@ describe('mapRustDiagnosticToVsCode', () => {
89 const [suggestedFix] = suggestedFixes; 89 const [suggestedFix] = suggestedFixes;
90 assert.strictEqual( 90 assert.strictEqual(
91 suggestedFix.title, 91 suggestedFix.title,
92 'consider prefixing with an underscore: `_foo`' 92 'consider prefixing with an underscore: `_foo`',
93 ); 93 );
94 assert.strictEqual( 94 assert.strictEqual(
95 suggestedFix.applicability, 95 suggestedFix.applicability,
96 SuggestionApplicability.MachineApplicable 96 SuggestionApplicability.MachineApplicable,
97 ); 97 );
98 }); 98 });
99 99
100 it('should map a wrong number of parameters error', () => { 100 it('should map a wrong number of parameters error', () => {
101 const { diagnostic, suggestedFixes } = mapFixtureToVsCode( 101 const { diagnostic, suggestedFixes } = mapFixtureToVsCode(
102 'error/E0061' 102 'error/E0061',
103 ); 103 );
104 104
105 assert.strictEqual( 105 assert.strictEqual(
106 diagnostic.severity, 106 diagnostic.severity,
107 vscode.DiagnosticSeverity.Error 107 vscode.DiagnosticSeverity.Error,
108 ); 108 );
109 assert.strictEqual( 109 assert.strictEqual(
110 diagnostic.message, 110 diagnostic.message,
111 [ 111 [
112 'this function takes 2 parameters but 3 parameters were supplied', 112 'this function takes 2 parameters but 3 parameters were supplied',
113 'expected 2 parameters' 113 'expected 2 parameters',
114 ].join('\n') 114 ].join('\n'),
115 ); 115 );
116 assert.strictEqual(diagnostic.code, 'E0061'); 116 assert.strictEqual(diagnostic.code, 'E0061');
117 assert.strictEqual(diagnostic.source, 'rustc'); 117 assert.strictEqual(diagnostic.source, 'rustc');
@@ -120,7 +120,8 @@ describe('mapRustDiagnosticToVsCode', () => {
120 // One related information for the original definition 120 // One related information for the original definition
121 const relatedInformation = diagnostic.relatedInformation; 121 const relatedInformation = diagnostic.relatedInformation;
122 if (!relatedInformation) { 122 if (!relatedInformation) {
123 return assert.fail('Related information unexpectedly undefined'); 123 assert.fail('Related information unexpectedly undefined');
124 return;
124 } 125 }
125 assert.strictEqual(relatedInformation.length, 1); 126 assert.strictEqual(relatedInformation.length, 1);
126 const [related] = relatedInformation; 127 const [related] = relatedInformation;
@@ -132,12 +133,12 @@ describe('mapRustDiagnosticToVsCode', () => {
132 133
133 it('should map a Clippy copy pass by ref warning', () => { 134 it('should map a Clippy copy pass by ref warning', () => {
134 const { diagnostic, suggestedFixes } = mapFixtureToVsCode( 135 const { diagnostic, suggestedFixes } = mapFixtureToVsCode(
135 'clippy/trivially_copy_pass_by_ref' 136 'clippy/trivially_copy_pass_by_ref',
136 ); 137 );
137 138
138 assert.strictEqual( 139 assert.strictEqual(
139 diagnostic.severity, 140 diagnostic.severity,
140 vscode.DiagnosticSeverity.Warning 141 vscode.DiagnosticSeverity.Warning,
141 ); 142 );
142 assert.strictEqual(diagnostic.source, 'clippy'); 143 assert.strictEqual(diagnostic.source, 'clippy');
143 assert.strictEqual( 144 assert.strictEqual(
@@ -145,8 +146,8 @@ describe('mapRustDiagnosticToVsCode', () => {
145 [ 146 [
146 'this argument is passed by reference, but would be more efficient if passed by value', 147 'this argument is passed by reference, but would be more efficient if passed by value',
147 '#[warn(clippy::trivially_copy_pass_by_ref)] implied by #[warn(clippy::all)]', 148 '#[warn(clippy::trivially_copy_pass_by_ref)] implied by #[warn(clippy::all)]',
148 'for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref' 149 'for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref',
149 ].join('\n') 150 ].join('\n'),
150 ); 151 );
151 assert.strictEqual(diagnostic.code, 'trivially_copy_pass_by_ref'); 152 assert.strictEqual(diagnostic.code, 'trivially_copy_pass_by_ref');
152 assert.deepStrictEqual(diagnostic.tags, []); 153 assert.deepStrictEqual(diagnostic.tags, []);
@@ -154,7 +155,8 @@ describe('mapRustDiagnosticToVsCode', () => {
154 // One related information for the lint definition 155 // One related information for the lint definition
155 const relatedInformation = diagnostic.relatedInformation; 156 const relatedInformation = diagnostic.relatedInformation;
156 if (!relatedInformation) { 157 if (!relatedInformation) {
157 return assert.fail('Related information unexpectedly undefined'); 158 assert.fail('Related information unexpectedly undefined');
159 return;
158 } 160 }
159 assert.strictEqual(relatedInformation.length, 1); 161 assert.strictEqual(relatedInformation.length, 1);
160 const [related] = relatedInformation; 162 const [related] = relatedInformation;
@@ -165,27 +167,27 @@ describe('mapRustDiagnosticToVsCode', () => {
165 const [suggestedFix] = suggestedFixes; 167 const [suggestedFix] = suggestedFixes;
166 assert.strictEqual( 168 assert.strictEqual(
167 suggestedFix.title, 169 suggestedFix.title,
168 'consider passing by value instead: `self`' 170 'consider passing by value instead: `self`',
169 ); 171 );
170 // Clippy does not mark this with any applicability 172 // Clippy does not mark this with any applicability
171 assert.strictEqual( 173 assert.strictEqual(
172 suggestedFix.applicability, 174 suggestedFix.applicability,
173 SuggestionApplicability.Unspecified 175 SuggestionApplicability.Unspecified,
174 ); 176 );
175 }); 177 });
176 178
177 it('should map a mismatched type error', () => { 179 it('should map a mismatched type error', () => {
178 const { diagnostic, suggestedFixes } = mapFixtureToVsCode( 180 const { diagnostic, suggestedFixes } = mapFixtureToVsCode(
179 'error/E0308' 181 'error/E0308',
180 ); 182 );
181 183
182 assert.strictEqual( 184 assert.strictEqual(
183 diagnostic.severity, 185 diagnostic.severity,
184 vscode.DiagnosticSeverity.Error 186 vscode.DiagnosticSeverity.Error,
185 ); 187 );
186 assert.strictEqual( 188 assert.strictEqual(
187 diagnostic.message, 189 diagnostic.message,
188 ['mismatched types', 'expected usize, found u32'].join('\n') 190 ['mismatched types', 'expected usize, found u32'].join('\n'),
189 ); 191 );
190 assert.strictEqual(diagnostic.code, 'E0308'); 192 assert.strictEqual(diagnostic.code, 'E0308');
191 assert.strictEqual(diagnostic.source, 'rustc'); 193 assert.strictEqual(diagnostic.source, 'rustc');
@@ -197,4 +199,38 @@ describe('mapRustDiagnosticToVsCode', () => {
197 // There are no suggested fixes 199 // There are no suggested fixes
198 assert.strictEqual(suggestedFixes.length, 0); 200 assert.strictEqual(suggestedFixes.length, 0);
199 }); 201 });
202
203 it('should map a macro invocation location to normal file path', () => {
204 const { location, diagnostic, suggestedFixes } = mapFixtureToVsCode(
205 'error/E0277',
206 );
207
208 assert.strictEqual(
209 diagnostic.severity,
210 vscode.DiagnosticSeverity.Error,
211 );
212 assert.strictEqual(
213 diagnostic.message,
214 [
215 "can't compare `{integer}` with `&str`",
216 'the trait `std::cmp::PartialEq<&str>` is not implemented for `{integer}`',
217 ].join('\n'),
218 );
219 assert.strictEqual(diagnostic.code, 'E0277');
220 assert.strictEqual(diagnostic.source, 'rustc');
221 assert.deepStrictEqual(diagnostic.tags, []);
222
223 // No related information
224 assert.deepStrictEqual(diagnostic.relatedInformation, []);
225
226 // There are no suggested fixes
227 assert.strictEqual(suggestedFixes.length, 0);
228
229 // The file url should be normal file
230 // Ignore the first part because it depends on vs workspace location
231 assert.strictEqual(
232 location.uri.path.substr(-'src/main.rs'.length),
233 'src/main.rs',
234 );
235 });
200}); 236});
diff --git a/editors/code/src/test/utils/diagnotics/vscode.test.ts b/editors/code/src/test/utils/diagnotics/vscode.test.ts
index 542dec1f5..4944dd032 100644
--- a/editors/code/src/test/utils/diagnotics/vscode.test.ts
+++ b/editors/code/src/test/utils/diagnotics/vscode.test.ts
@@ -5,12 +5,12 @@ import { areDiagnosticsEqual } from '../../../utils/diagnostics/vscode';
5 5
6const range1 = new vscode.Range( 6const range1 = new vscode.Range(
7 new vscode.Position(1, 2), 7 new vscode.Position(1, 2),
8 new vscode.Position(3, 4) 8 new vscode.Position(3, 4),
9); 9);
10 10
11const range2 = new vscode.Range( 11const range2 = new vscode.Range(
12 new vscode.Position(5, 6), 12 new vscode.Position(5, 6),
13 new vscode.Position(7, 8) 13 new vscode.Position(7, 8),
14); 14);
15 15
16describe('areDiagnosticsEqual', () => { 16describe('areDiagnosticsEqual', () => {
@@ -18,13 +18,13 @@ describe('areDiagnosticsEqual', () => {
18 const diagnostic1 = new vscode.Diagnostic( 18 const diagnostic1 = new vscode.Diagnostic(
19 range1, 19 range1,
20 'Hello, world!', 20 'Hello, world!',
21 vscode.DiagnosticSeverity.Error 21 vscode.DiagnosticSeverity.Error,
22 ); 22 );
23 23
24 const diagnostic2 = new vscode.Diagnostic( 24 const diagnostic2 = new vscode.Diagnostic(
25 range1, 25 range1,
26 'Hello, world!', 26 'Hello, world!',
27 vscode.DiagnosticSeverity.Error 27 vscode.DiagnosticSeverity.Error,
28 ); 28 );
29 29
30 assert(areDiagnosticsEqual(diagnostic1, diagnostic2)); 30 assert(areDiagnosticsEqual(diagnostic1, diagnostic2));
@@ -34,14 +34,14 @@ describe('areDiagnosticsEqual', () => {
34 const diagnostic1 = new vscode.Diagnostic( 34 const diagnostic1 = new vscode.Diagnostic(
35 range1, 35 range1,
36 'Hello, world!', 36 'Hello, world!',
37 vscode.DiagnosticSeverity.Error 37 vscode.DiagnosticSeverity.Error,
38 ); 38 );
39 diagnostic1.source = 'rustc'; 39 diagnostic1.source = 'rustc';
40 40
41 const diagnostic2 = new vscode.Diagnostic( 41 const diagnostic2 = new vscode.Diagnostic(
42 range1, 42 range1,
43 'Hello, world!', 43 'Hello, world!',
44 vscode.DiagnosticSeverity.Error 44 vscode.DiagnosticSeverity.Error,
45 ); 45 );
46 diagnostic2.source = 'clippy'; 46 diagnostic2.source = 'clippy';
47 47
@@ -52,13 +52,13 @@ describe('areDiagnosticsEqual', () => {
52 const diagnostic1 = new vscode.Diagnostic( 52 const diagnostic1 = new vscode.Diagnostic(
53 range1, 53 range1,
54 'Hello, world!', 54 'Hello, world!',
55 vscode.DiagnosticSeverity.Error 55 vscode.DiagnosticSeverity.Error,
56 ); 56 );
57 57
58 const diagnostic2 = new vscode.Diagnostic( 58 const diagnostic2 = new vscode.Diagnostic(
59 range2, 59 range2,
60 'Hello, world!', 60 'Hello, world!',
61 vscode.DiagnosticSeverity.Error 61 vscode.DiagnosticSeverity.Error,
62 ); 62 );
63 63
64 assert(!areDiagnosticsEqual(diagnostic1, diagnostic2)); 64 assert(!areDiagnosticsEqual(diagnostic1, diagnostic2));
@@ -68,13 +68,13 @@ describe('areDiagnosticsEqual', () => {
68 const diagnostic1 = new vscode.Diagnostic( 68 const diagnostic1 = new vscode.Diagnostic(
69 range1, 69 range1,
70 'Hello, world!', 70 'Hello, world!',
71 vscode.DiagnosticSeverity.Error 71 vscode.DiagnosticSeverity.Error,
72 ); 72 );
73 73
74 const diagnostic2 = new vscode.Diagnostic( 74 const diagnostic2 = new vscode.Diagnostic(
75 range1, 75 range1,
76 'Goodbye!, world!', 76 'Goodbye!, world!',
77 vscode.DiagnosticSeverity.Error 77 vscode.DiagnosticSeverity.Error,
78 ); 78 );
79 79
80 assert(!areDiagnosticsEqual(diagnostic1, diagnostic2)); 80 assert(!areDiagnosticsEqual(diagnostic1, diagnostic2));
@@ -84,13 +84,13 @@ describe('areDiagnosticsEqual', () => {
84 const diagnostic1 = new vscode.Diagnostic( 84 const diagnostic1 = new vscode.Diagnostic(
85 range1, 85 range1,
86 'Hello, world!', 86 'Hello, world!',
87 vscode.DiagnosticSeverity.Warning 87 vscode.DiagnosticSeverity.Warning,
88 ); 88 );
89 89
90 const diagnostic2 = new vscode.Diagnostic( 90 const diagnostic2 = new vscode.Diagnostic(
91 range1, 91 range1,
92 'Hello, world!', 92 'Hello, world!',
93 vscode.DiagnosticSeverity.Error 93 vscode.DiagnosticSeverity.Error,
94 ); 94 );
95 95
96 assert(!areDiagnosticsEqual(diagnostic1, diagnostic2)); 96 assert(!areDiagnosticsEqual(diagnostic1, diagnostic2));
diff --git a/editors/code/src/test/utils/index.ts b/editors/code/src/test/utils/index.ts
index 16715a286..9927daaf6 100644
--- a/editors/code/src/test/utils/index.ts
+++ b/editors/code/src/test/utils/index.ts
@@ -17,7 +17,7 @@ import * as path from 'path';
17export function run(): Promise<void> { 17export function run(): Promise<void> {
18 // Create the mocha test 18 // Create the mocha test
19 const mocha = new Mocha({ 19 const mocha = new Mocha({
20 ui: 'bdd' 20 ui: 'bdd',
21 }); 21 });
22 mocha.useColors(true); 22 mocha.useColors(true);
23 23
diff --git a/editors/code/src/utils/diagnostics/SuggestedFix.ts b/editors/code/src/utils/diagnostics/SuggestedFix.ts
index b1be2a225..6e660bb61 100644
--- a/editors/code/src/utils/diagnostics/SuggestedFix.ts
+++ b/editors/code/src/utils/diagnostics/SuggestedFix.ts
@@ -24,7 +24,7 @@ export default class SuggestedFix {
24 title: string, 24 title: string,
25 location: vscode.Location, 25 location: vscode.Location,
26 replacement: string, 26 replacement: string,
27 applicability: SuggestionApplicability = SuggestionApplicability.Unspecified 27 applicability: SuggestionApplicability = SuggestionApplicability.Unspecified,
28 ) { 28 ) {
29 this.title = title; 29 this.title = title;
30 this.location = location; 30 this.location = location;
@@ -51,7 +51,7 @@ export default class SuggestedFix {
51 public toCodeAction(): vscode.CodeAction { 51 public toCodeAction(): vscode.CodeAction {
52 const codeAction = new vscode.CodeAction( 52 const codeAction = new vscode.CodeAction(
53 this.title, 53 this.title,
54 vscode.CodeActionKind.QuickFix 54 vscode.CodeActionKind.QuickFix,
55 ); 55 );
56 56
57 const edit = new vscode.WorkspaceEdit(); 57 const edit = new vscode.WorkspaceEdit();
diff --git a/editors/code/src/utils/diagnostics/SuggestedFixCollection.ts b/editors/code/src/utils/diagnostics/SuggestedFixCollection.ts
index 132ce12f8..57c9856cf 100644
--- a/editors/code/src/utils/diagnostics/SuggestedFixCollection.ts
+++ b/editors/code/src/utils/diagnostics/SuggestedFixCollection.ts
@@ -38,13 +38,13 @@ export default class SuggestedFixCollection
38 */ 38 */
39 public addSuggestedFixForDiagnostic( 39 public addSuggestedFixForDiagnostic(
40 suggestedFix: SuggestedFix, 40 suggestedFix: SuggestedFix,
41 diagnostic: vscode.Diagnostic 41 diagnostic: vscode.Diagnostic,
42 ): void { 42 ): void {
43 const fileUriString = suggestedFix.location.uri.toString(); 43 const fileUriString = suggestedFix.location.uri.toString();
44 const fileSuggestions = this.suggestedFixes.get(fileUriString) || []; 44 const fileSuggestions = this.suggestedFixes.get(fileUriString) || [];
45 45
46 const existingSuggestion = fileSuggestions.find(s => 46 const existingSuggestion = fileSuggestions.find(s =>
47 s.isEqual(suggestedFix) 47 s.isEqual(suggestedFix),
48 ); 48 );
49 49
50 if (existingSuggestion) { 50 if (existingSuggestion) {
@@ -65,7 +65,7 @@ export default class SuggestedFixCollection
65 */ 65 */
66 public provideCodeActions( 66 public provideCodeActions(
67 document: vscode.TextDocument, 67 document: vscode.TextDocument,
68 range: vscode.Range 68 range: vscode.Range,
69 ): vscode.CodeAction[] { 69 ): vscode.CodeAction[] {
70 const documentUriString = document.uri.toString(); 70 const documentUriString = document.uri.toString();
71 71
diff --git a/editors/code/src/utils/diagnostics/rust.ts b/editors/code/src/utils/diagnostics/rust.ts
index 0550d0372..1f0c0d3e4 100644
--- a/editors/code/src/utils/diagnostics/rust.ts
+++ b/editors/code/src/utils/diagnostics/rust.ts
@@ -7,7 +7,13 @@ export enum SuggestionApplicability {
7 MachineApplicable = 'MachineApplicable', 7 MachineApplicable = 'MachineApplicable',
8 HasPlaceholders = 'HasPlaceholders', 8 HasPlaceholders = 'HasPlaceholders',
9 MaybeIncorrect = 'MaybeIncorrect', 9 MaybeIncorrect = 'MaybeIncorrect',
10 Unspecified = 'Unspecified' 10 Unspecified = 'Unspecified',
11}
12
13export interface RustDiagnosticSpanMacroExpansion {
14 span: RustDiagnosticSpan;
15 macro_decl_name: string;
16 def_site_span?: RustDiagnosticSpan;
11} 17}
12 18
13// Reference: 19// Reference:
@@ -20,6 +26,7 @@ export interface RustDiagnosticSpan {
20 is_primary: boolean; 26 is_primary: boolean;
21 file_name: string; 27 file_name: string;
22 label?: string; 28 label?: string;
29 expansion?: RustDiagnosticSpanMacroExpansion;
23 suggested_replacement?: string; 30 suggested_replacement?: string;
24 suggestion_applicability?: SuggestionApplicability; 31 suggestion_applicability?: SuggestionApplicability;
25} 32}
@@ -61,15 +68,46 @@ function mapLevelToSeverity(s: string): vscode.DiagnosticSeverity {
61} 68}
62 69
63/** 70/**
71 * Check whether a file name is from macro invocation
72 */
73function isFromMacro(fileName: string): boolean {
74 return fileName.startsWith('<') && fileName.endsWith('>');
75}
76
77/**
78 * Converts a Rust macro span to a VsCode location recursively
79 */
80function mapMacroSpanToLocation(
81 spanMacro: RustDiagnosticSpanMacroExpansion,
82): vscode.Location | undefined {
83 if (!isFromMacro(spanMacro.span.file_name)) {
84 return mapSpanToLocation(spanMacro.span);
85 }
86
87 if (spanMacro.span.expansion) {
88 return mapMacroSpanToLocation(spanMacro.span.expansion);
89 }
90
91 return;
92}
93
94/**
64 * Converts a Rust span to a VsCode location 95 * Converts a Rust span to a VsCode location
65 */ 96 */
66function mapSpanToLocation(span: RustDiagnosticSpan): vscode.Location { 97function mapSpanToLocation(span: RustDiagnosticSpan): vscode.Location {
98 if (isFromMacro(span.file_name) && span.expansion) {
99 const macroLoc = mapMacroSpanToLocation(span.expansion);
100 if (macroLoc) {
101 return macroLoc;
102 }
103 }
104
67 const fileName = path.join(vscode.workspace.rootPath || '', span.file_name); 105 const fileName = path.join(vscode.workspace.rootPath || '', span.file_name);
68 const fileUri = vscode.Uri.file(fileName); 106 const fileUri = vscode.Uri.file(fileName);
69 107
70 const range = new vscode.Range( 108 const range = new vscode.Range(
71 new vscode.Position(span.line_start - 1, span.column_start - 1), 109 new vscode.Position(span.line_start - 1, span.column_start - 1),
72 new vscode.Position(span.line_end - 1, span.column_end - 1) 110 new vscode.Position(span.line_end - 1, span.column_end - 1),
73 ); 111 );
74 112
75 return new vscode.Location(fileUri, range); 113 return new vscode.Location(fileUri, range);
@@ -81,7 +119,7 @@ function mapSpanToLocation(span: RustDiagnosticSpan): vscode.Location {
81 * If the span is unlabelled this will return `undefined`. 119 * If the span is unlabelled this will return `undefined`.
82 */ 120 */
83function mapSecondarySpanToRelated( 121function mapSecondarySpanToRelated(
84 span: RustDiagnosticSpan 122 span: RustDiagnosticSpan,
85): vscode.DiagnosticRelatedInformation | undefined { 123): vscode.DiagnosticRelatedInformation | undefined {
86 if (!span.label) { 124 if (!span.label) {
87 // Nothing to label this with 125 // Nothing to label this with
@@ -107,7 +145,7 @@ function isUnusedOrUnnecessary(rd: RustDiagnostic): boolean {
107 'unused_attributes', 145 'unused_attributes',
108 'unused_imports', 146 'unused_imports',
109 'unused_macros', 147 'unused_macros',
110 'unused_variables' 148 'unused_variables',
111 ].includes(rd.code.code); 149 ].includes(rd.code.code);
112} 150}
113 151
@@ -157,13 +195,13 @@ function mapRustChildDiagnostic(rd: RustDiagnostic): MappedRustChildDiagnostic {
157 title, 195 title,
158 location, 196 location,
159 span.suggested_replacement, 197 span.suggested_replacement,
160 span.suggestion_applicability 198 span.suggestion_applicability,
161 ) 199 ),
162 }; 200 };
163 } else { 201 } else {
164 const related = new vscode.DiagnosticRelatedInformation( 202 const related = new vscode.DiagnosticRelatedInformation(
165 location, 203 location,
166 rd.message 204 rd.message,
167 ); 205 );
168 206
169 return { related }; 207 return { related };
@@ -183,7 +221,7 @@ function mapRustChildDiagnostic(rd: RustDiagnostic): MappedRustChildDiagnostic {
183 * If the diagnostic has no primary span this will return `undefined` 221 * If the diagnostic has no primary span this will return `undefined`
184 */ 222 */
185export function mapRustDiagnosticToVsCode( 223export function mapRustDiagnosticToVsCode(
186 rd: RustDiagnostic 224 rd: RustDiagnostic,
187): MappedRustDiagnostic | undefined { 225): MappedRustDiagnostic | undefined {
188 const primarySpan = rd.spans.find(s => s.is_primary); 226 const primarySpan = rd.spans.find(s => s.is_primary);
189 if (!primarySpan) { 227 if (!primarySpan) {
@@ -223,7 +261,7 @@ export function mapRustDiagnosticToVsCode(
223 const suggestedFixes = []; 261 const suggestedFixes = [];
224 for (const child of rd.children) { 262 for (const child of rd.children) {
225 const { related, suggestedFix, messageLine } = mapRustChildDiagnostic( 263 const { related, suggestedFix, messageLine } = mapRustChildDiagnostic(
226 child 264 child,
227 ); 265 );
228 266
229 if (related) { 267 if (related) {
@@ -256,6 +294,6 @@ export function mapRustDiagnosticToVsCode(
256 return { 294 return {
257 location, 295 location,
258 diagnostic: vd, 296 diagnostic: vd,
259 suggestedFixes 297 suggestedFixes,
260 }; 298 };
261} 299}
diff --git a/editors/code/src/utils/diagnostics/vscode.ts b/editors/code/src/utils/diagnostics/vscode.ts
index d8b85b720..f4a5450e2 100644
--- a/editors/code/src/utils/diagnostics/vscode.ts
+++ b/editors/code/src/utils/diagnostics/vscode.ts
@@ -3,7 +3,7 @@ import * as vscode from 'vscode';
3/** Compares two `vscode.Diagnostic`s for equality */ 3/** Compares two `vscode.Diagnostic`s for equality */
4export function areDiagnosticsEqual( 4export function areDiagnosticsEqual(
5 left: vscode.Diagnostic, 5 left: vscode.Diagnostic,
6 right: vscode.Diagnostic 6 right: vscode.Diagnostic,
7): boolean { 7): boolean {
8 return ( 8 return (
9 left.source === right.source && 9 left.source === right.source &&
diff --git a/editors/code/src/utils/processes.ts b/editors/code/src/utils/processes.ts
index da8be9eb1..a1d6b7eaf 100644
--- a/editors/code/src/utils/processes.ts
+++ b/editors/code/src/utils/processes.ts
@@ -22,7 +22,7 @@ export function terminate(process: ChildProcess, cwd?: string): boolean {
22 // Ignore stderr since this is otherwise piped to parent.stderr 22 // Ignore stderr since this is otherwise piped to parent.stderr
23 // which might be already closed. 23 // which might be already closed.
24 const options: any = { 24 const options: any = {
25 stdio: ['pipe', 'pipe', 'ignore'] 25 stdio: ['pipe', 'pipe', 'ignore'],
26 }; 26 };
27 if (cwd) { 27 if (cwd) {
28 options.cwd = cwd; 28 options.cwd = cwd;
@@ -30,7 +30,7 @@ export function terminate(process: ChildProcess, cwd?: string): boolean {
30 cp.execFileSync( 30 cp.execFileSync(
31 'taskkill', 31 'taskkill',
32 ['/T', '/F', '/PID', process.pid.toString()], 32 ['/T', '/F', '/PID', process.pid.toString()],
33 options 33 options,
34 ); 34 );
35 return true; 35 return true;
36 } catch (err) { 36 } catch (err) {
diff --git a/editors/code/tsconfig.json b/editors/code/tsconfig.json
index 9ad2e967b..5e11c3775 100644
--- a/editors/code/tsconfig.json
+++ b/editors/code/tsconfig.json
@@ -1,13 +1,16 @@
1{ 1{
2 "compilerOptions": { 2 "compilerOptions": {
3 "module": "commonjs", 3 "module": "commonjs",
4 "target": "es6", 4 "target": "es2018",
5 "outDir": "out", 5 "outDir": "out",
6 "lib": ["es6"], 6 "lib": ["es2018"],
7 "sourceMap": true, 7 "sourceMap": true,
8 "rootDir": "src", 8 "rootDir": "src",
9 "strict": true, 9 "strict": true,
10 "noUnusedLocals": true 10 "noUnusedLocals": true,
11 "noUnusedParameters": true,
12 "noImplicitReturns": true,
13 "noFallthroughCasesInSwitch": true
11 }, 14 },
12 "exclude": ["node_modules", ".vscode-test"] 15 "exclude": ["node_modules", ".vscode-test"]
13} 16}
diff --git a/editors/code/tslint.json b/editors/code/tslint.json
index bdeb4895e..f06fa5fab 100644
--- a/editors/code/tslint.json
+++ b/editors/code/tslint.json
@@ -1,9 +1,15 @@
1{ 1{
2 "defaultSeverity": "error", 2 "defaultSeverity": "error",
3 "extends": ["tslint:recommended", "tslint-config-prettier"], 3 "extends": [
4 "tslint:recommended",
5 "tslint-config-prettier",
6 "tslint-plugin-prettier"
7 ],
4 "rules": { 8 "rules": {
5 "quotemark": [true, "single"],
6 "interface-name": false, 9 "interface-name": false,
7 "object-literal-sort-keys": false 10 "prettier": true,
11 "object-literal-sort-keys": false,
12 // Allow `_bar` to sort with tsc's `noUnusedParameters` option
13 "variable-name": [true, "allow-leading-underscore"]
8 } 14 }
9} 15}