diff options
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/package-lock.json | 215 | ||||
-rw-r--r-- | editors/code/package.json | 30 | ||||
-rw-r--r-- | editors/code/src/commands/index.ts | 4 | ||||
-rw-r--r-- | editors/code/src/commands/inlay_hints.ts | 109 | ||||
-rw-r--r-- | editors/code/src/config.ts | 5 | ||||
-rw-r--r-- | editors/code/src/extension.ts | 24 |
6 files changed, 265 insertions, 122 deletions
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json index b924b2471..56cac1b49 100644 --- a/editors/code/package-lock.json +++ b/editors/code/package-lock.json | |||
@@ -5,18 +5,18 @@ | |||
5 | "requires": true, | 5 | "requires": true, |
6 | "dependencies": { | 6 | "dependencies": { |
7 | "@babel/code-frame": { | 7 | "@babel/code-frame": { |
8 | "version": "7.0.0", | 8 | "version": "7.5.5", |
9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", | 9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", |
10 | "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", | 10 | "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", |
11 | "dev": true, | 11 | "dev": true, |
12 | "requires": { | 12 | "requires": { |
13 | "@babel/highlight": "^7.0.0" | 13 | "@babel/highlight": "^7.0.0" |
14 | } | 14 | } |
15 | }, | 15 | }, |
16 | "@babel/highlight": { | 16 | "@babel/highlight": { |
17 | "version": "7.0.0", | 17 | "version": "7.5.0", |
18 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", | 18 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", |
19 | "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", | 19 | "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", |
20 | "dev": true, | 20 | "dev": true, |
21 | "requires": { | 21 | "requires": { |
22 | "chalk": "^2.0.0", | 22 | "chalk": "^2.0.0", |
@@ -25,15 +25,15 @@ | |||
25 | } | 25 | } |
26 | }, | 26 | }, |
27 | "@types/mocha": { | 27 | "@types/mocha": { |
28 | "version": "5.2.6", | 28 | "version": "5.2.7", |
29 | "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.6.tgz", | 29 | "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", |
30 | "integrity": "sha512-1axi39YdtBI7z957vdqXI4Ac25e7YihYQtJa+Clnxg1zTJEaIRbndt71O3sP4GAMgiAm0pY26/b9BrY4MR/PMw==", | 30 | "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", |
31 | "dev": true | 31 | "dev": true |
32 | }, | 32 | }, |
33 | "@types/node": { | 33 | "@types/node": { |
34 | "version": "10.14.5", | 34 | "version": "10.14.13", |
35 | "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.5.tgz", | 35 | "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.13.tgz", |
36 | "integrity": "sha512-Ja7d4s0qyGFxjGeDq5S7Si25OFibSAHUi6i17UWnwNnpitADN7hah9q0Tl25gxuV5R1u2Bx+np6w4LHXfHyj/g==", | 36 | "integrity": "sha512-yN/FNNW1UYsRR1wwAoyOwqvDuLDtVXnaJTZ898XIw/Q5cCaeVAlVwvsmXLX5PuiScBYwZsZU4JYSHB3TvfdwvQ==", |
37 | "dev": true | 37 | "dev": true |
38 | }, | 38 | }, |
39 | "@types/seedrandom": { | 39 | "@types/seedrandom": { |
@@ -43,18 +43,18 @@ | |||
43 | "dev": true | 43 | "dev": true |
44 | }, | 44 | }, |
45 | "agent-base": { | 45 | "agent-base": { |
46 | "version": "4.2.1", | 46 | "version": "4.3.0", |
47 | "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", | 47 | "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", |
48 | "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", | 48 | "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", |
49 | "dev": true, | 49 | "dev": true, |
50 | "requires": { | 50 | "requires": { |
51 | "es6-promisify": "^5.0.0" | 51 | "es6-promisify": "^5.0.0" |
52 | } | 52 | } |
53 | }, | 53 | }, |
54 | "ajv": { | 54 | "ajv": { |
55 | "version": "6.10.0", | 55 | "version": "6.10.2", |
56 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", | 56 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", |
57 | "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", | 57 | "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", |
58 | "dev": true, | 58 | "dev": true, |
59 | "requires": { | 59 | "requires": { |
60 | "fast-deep-equal": "^2.0.1", | 60 | "fast-deep-equal": "^2.0.1", |
@@ -158,9 +158,9 @@ | |||
158 | } | 158 | } |
159 | }, | 159 | }, |
160 | "browser-stdout": { | 160 | "browser-stdout": { |
161 | "version": "1.3.0", | 161 | "version": "1.3.1", |
162 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", | 162 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", |
163 | "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", | 163 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", |
164 | "dev": true | 164 | "dev": true |
165 | }, | 165 | }, |
166 | "buffer-crc32": { | 166 | "buffer-crc32": { |
@@ -228,9 +228,9 @@ | |||
228 | "dev": true | 228 | "dev": true |
229 | }, | 229 | }, |
230 | "combined-stream": { | 230 | "combined-stream": { |
231 | "version": "1.0.7", | 231 | "version": "1.0.8", |
232 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", | 232 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", |
233 | "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", | 233 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", |
234 | "dev": true, | 234 | "dev": true, |
235 | "requires": { | 235 | "requires": { |
236 | "delayed-stream": "~1.0.0" | 236 | "delayed-stream": "~1.0.0" |
@@ -372,9 +372,9 @@ | |||
372 | "dev": true | 372 | "dev": true |
373 | }, | 373 | }, |
374 | "es6-promise": { | 374 | "es6-promise": { |
375 | "version": "4.2.6", | 375 | "version": "4.2.8", |
376 | "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", | 376 | "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", |
377 | "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==", | 377 | "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", |
378 | "dev": true | 378 | "dev": true |
379 | }, | 379 | }, |
380 | "es6-promisify": { | 380 | "es6-promisify": { |
@@ -484,9 +484,9 @@ | |||
484 | } | 484 | } |
485 | }, | 485 | }, |
486 | "growl": { | 486 | "growl": { |
487 | "version": "1.10.3", | 487 | "version": "1.10.5", |
488 | "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", | 488 | "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", |
489 | "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", | 489 | "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", |
490 | "dev": true | 490 | "dev": true |
491 | }, | 491 | }, |
492 | "har-schema": { | 492 | "har-schema": { |
@@ -553,12 +553,12 @@ | |||
553 | } | 553 | } |
554 | }, | 554 | }, |
555 | "https-proxy-agent": { | 555 | "https-proxy-agent": { |
556 | "version": "2.2.1", | 556 | "version": "2.2.2", |
557 | "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", | 557 | "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", |
558 | "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", | 558 | "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", |
559 | "dev": true, | 559 | "dev": true, |
560 | "requires": { | 560 | "requires": { |
561 | "agent-base": "^4.1.0", | 561 | "agent-base": "^4.3.0", |
562 | "debug": "^3.1.0" | 562 | "debug": "^3.1.0" |
563 | } | 563 | } |
564 | }, | 564 | }, |
@@ -649,18 +649,18 @@ | |||
649 | } | 649 | } |
650 | }, | 650 | }, |
651 | "linkify-it": { | 651 | "linkify-it": { |
652 | "version": "2.1.0", | 652 | "version": "2.2.0", |
653 | "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.1.0.tgz", | 653 | "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", |
654 | "integrity": "sha512-4REs8/062kV2DSHxNfq5183zrqXMl7WP0WzABH9IeJI+NLm429FgE1PDecltYfnOoFDFlZGh2T8PfZn0r+GTRg==", | 654 | "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", |
655 | "dev": true, | 655 | "dev": true, |
656 | "requires": { | 656 | "requires": { |
657 | "uc.micro": "^1.0.1" | 657 | "uc.micro": "^1.0.1" |
658 | } | 658 | } |
659 | }, | 659 | }, |
660 | "lodash": { | 660 | "lodash": { |
661 | "version": "4.17.14", | 661 | "version": "4.17.15", |
662 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", | 662 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", |
663 | "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", | 663 | "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", |
664 | "dev": true | 664 | "dev": true |
665 | }, | 665 | }, |
666 | "markdown-it": { | 666 | "markdown-it": { |
@@ -728,33 +728,28 @@ | |||
728 | } | 728 | } |
729 | }, | 729 | }, |
730 | "mocha": { | 730 | "mocha": { |
731 | "version": "4.1.0", | 731 | "version": "5.2.0", |
732 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", | 732 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", |
733 | "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", | 733 | "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", |
734 | "dev": true, | 734 | "dev": true, |
735 | "requires": { | 735 | "requires": { |
736 | "browser-stdout": "1.3.0", | 736 | "browser-stdout": "1.3.1", |
737 | "commander": "2.11.0", | 737 | "commander": "2.15.1", |
738 | "debug": "3.1.0", | 738 | "debug": "3.1.0", |
739 | "diff": "3.3.1", | 739 | "diff": "3.5.0", |
740 | "escape-string-regexp": "1.0.5", | 740 | "escape-string-regexp": "1.0.5", |
741 | "glob": "7.1.2", | 741 | "glob": "7.1.2", |
742 | "growl": "1.10.3", | 742 | "growl": "1.10.5", |
743 | "he": "1.1.1", | 743 | "he": "1.1.1", |
744 | "minimatch": "3.0.4", | ||
744 | "mkdirp": "0.5.1", | 745 | "mkdirp": "0.5.1", |
745 | "supports-color": "4.4.0" | 746 | "supports-color": "5.4.0" |
746 | }, | 747 | }, |
747 | "dependencies": { | 748 | "dependencies": { |
748 | "commander": { | 749 | "commander": { |
749 | "version": "2.11.0", | 750 | "version": "2.15.1", |
750 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", | 751 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", |
751 | "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", | 752 | "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", |
752 | "dev": true | ||
753 | }, | ||
754 | "diff": { | ||
755 | "version": "3.3.1", | ||
756 | "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", | ||
757 | "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", | ||
758 | "dev": true | 753 | "dev": true |
759 | }, | 754 | }, |
760 | "glob": { | 755 | "glob": { |
@@ -771,19 +766,13 @@ | |||
771 | "path-is-absolute": "^1.0.0" | 766 | "path-is-absolute": "^1.0.0" |
772 | } | 767 | } |
773 | }, | 768 | }, |
774 | "has-flag": { | ||
775 | "version": "2.0.0", | ||
776 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", | ||
777 | "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", | ||
778 | "dev": true | ||
779 | }, | ||
780 | "supports-color": { | 769 | "supports-color": { |
781 | "version": "4.4.0", | 770 | "version": "5.4.0", |
782 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", | 771 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", |
783 | "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", | 772 | "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", |
784 | "dev": true, | 773 | "dev": true, |
785 | "requires": { | 774 | "requires": { |
786 | "has-flag": "^2.0.0" | 775 | "has-flag": "^3.0.0" |
787 | } | 776 | } |
788 | } | 777 | } |
789 | } | 778 | } |
@@ -895,15 +884,15 @@ | |||
895 | "dev": true | 884 | "dev": true |
896 | }, | 885 | }, |
897 | "prettier": { | 886 | "prettier": { |
898 | "version": "1.17.0", | 887 | "version": "1.18.2", |
899 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.0.tgz", | 888 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", |
900 | "integrity": "sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==", | 889 | "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", |
901 | "dev": true | 890 | "dev": true |
902 | }, | 891 | }, |
903 | "psl": { | 892 | "psl": { |
904 | "version": "1.1.31", | 893 | "version": "1.2.0", |
905 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", | 894 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.2.0.tgz", |
906 | "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", | 895 | "integrity": "sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==", |
907 | "dev": true | 896 | "dev": true |
908 | }, | 897 | }, |
909 | "punycode": { | 898 | "punycode": { |
@@ -1133,15 +1122,15 @@ | |||
1133 | } | 1122 | } |
1134 | }, | 1123 | }, |
1135 | "tslib": { | 1124 | "tslib": { |
1136 | "version": "1.9.3", | 1125 | "version": "1.10.0", |
1137 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", | 1126 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", |
1138 | "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", | 1127 | "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", |
1139 | "dev": true | 1128 | "dev": true |
1140 | }, | 1129 | }, |
1141 | "tslint": { | 1130 | "tslint": { |
1142 | "version": "5.16.0", | 1131 | "version": "5.18.0", |
1143 | "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.16.0.tgz", | 1132 | "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", |
1144 | "integrity": "sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA==", | 1133 | "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", |
1145 | "dev": true, | 1134 | "dev": true, |
1146 | "requires": { | 1135 | "requires": { |
1147 | "@babel/code-frame": "^7.0.0", | 1136 | "@babel/code-frame": "^7.0.0", |
@@ -1150,7 +1139,7 @@ | |||
1150 | "commander": "^2.12.1", | 1139 | "commander": "^2.12.1", |
1151 | "diff": "^3.2.0", | 1140 | "diff": "^3.2.0", |
1152 | "glob": "^7.1.1", | 1141 | "glob": "^7.1.1", |
1153 | "js-yaml": "^3.13.0", | 1142 | "js-yaml": "^3.13.1", |
1154 | "minimatch": "^3.0.4", | 1143 | "minimatch": "^3.0.4", |
1155 | "mkdirp": "^0.5.1", | 1144 | "mkdirp": "^0.5.1", |
1156 | "resolve": "^1.3.2", | 1145 | "resolve": "^1.3.2", |
@@ -1206,9 +1195,9 @@ | |||
1206 | } | 1195 | } |
1207 | }, | 1196 | }, |
1208 | "typescript": { | 1197 | "typescript": { |
1209 | "version": "3.4.4", | 1198 | "version": "3.5.3", |
1210 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.4.tgz", | 1199 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", |
1211 | "integrity": "sha512-xt5RsIRCEaf6+j9AyOBgvVuAec0i92rgCaS3S+UVf5Z/vF2Hvtsw08wtUTJqp4djwznoAgjSxeCcU4r+CcDBJA==", | 1200 | "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", |
1212 | "dev": true | 1201 | "dev": true |
1213 | }, | 1202 | }, |
1214 | "uc.micro": { | 1203 | "uc.micro": { |
@@ -1239,12 +1228,12 @@ | |||
1239 | "dev": true | 1228 | "dev": true |
1240 | }, | 1229 | }, |
1241 | "url-parse": { | 1230 | "url-parse": { |
1242 | "version": "1.4.6", | 1231 | "version": "1.4.7", |
1243 | "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.6.tgz", | 1232 | "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", |
1244 | "integrity": "sha512-/B8AD9iQ01seoXmXf9z/MjLZQIdOoYl/+gvsQF6+mpnxaTfG9P7srYaiqaDMyKkR36XMXfhqSHss5MyFAO8lew==", | 1233 | "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", |
1245 | "dev": true, | 1234 | "dev": true, |
1246 | "requires": { | 1235 | "requires": { |
1247 | "querystringify": "^2.0.0", | 1236 | "querystringify": "^2.1.1", |
1248 | "requires-port": "^1.0.0" | 1237 | "requires-port": "^1.0.0" |
1249 | } | 1238 | } |
1250 | }, | 1239 | }, |
@@ -1272,9 +1261,9 @@ | |||
1272 | } | 1261 | } |
1273 | }, | 1262 | }, |
1274 | "vsce": { | 1263 | "vsce": { |
1275 | "version": "1.64.0", | 1264 | "version": "1.66.0", |
1276 | "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.64.0.tgz", | 1265 | "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.66.0.tgz", |
1277 | "integrity": "sha512-t3R7QTe2nAXQZs2kD+nA8GjdlX8pAQlnzxaNTG2976i5cyQ8r+ZsMNa/f9PDt7bhjcQM+u/fL+LkNuw+hwoy2A==", | 1266 | "integrity": "sha512-Zf4+WD4PhEcOr7jkU08SI9lwFqDhmhk73YOCGQ/tNLaBy+PnnX4eSdqj9LdzDLuI2dsyomJLXzDSNgxuaInxCQ==", |
1278 | "dev": true, | 1267 | "dev": true, |
1279 | "requires": { | 1268 | "requires": { |
1280 | "azure-devops-node-api": "^7.2.0", | 1269 | "azure-devops-node-api": "^7.2.0", |
@@ -1300,52 +1289,52 @@ | |||
1300 | } | 1289 | } |
1301 | }, | 1290 | }, |
1302 | "vscode": { | 1291 | "vscode": { |
1303 | "version": "1.1.33", | 1292 | "version": "1.1.35", |
1304 | "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.33.tgz", | 1293 | "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.35.tgz", |
1305 | "integrity": "sha512-sXedp2oF6y4ZvqrrFiZpeMzaCLSWV+PpYkIxjG/iYquNZ9KrLL2LujltGxPLvzn49xu2sZkyC+avVNFgcJD1Iw==", | 1294 | "integrity": "sha512-xPnxzQU40LOS2yPyzWW+WKpTV6qA3z16TcgpZ9O38UWLA157Zz4GxUx5H7Gd07pxzw0GqvusbF4D+5GBgNxvEQ==", |
1306 | "dev": true, | 1295 | "dev": true, |
1307 | "requires": { | 1296 | "requires": { |
1308 | "glob": "^7.1.2", | 1297 | "glob": "^7.1.2", |
1309 | "mocha": "^4.0.1", | 1298 | "mocha": "^5.2.0", |
1310 | "request": "^2.88.0", | 1299 | "request": "^2.88.0", |
1311 | "semver": "^5.4.1", | 1300 | "semver": "^5.4.1", |
1312 | "source-map-support": "^0.5.0", | 1301 | "source-map-support": "^0.5.0", |
1313 | "url-parse": "^1.4.4", | 1302 | "url-parse": "^1.4.4", |
1314 | "vscode-test": "^0.1.4" | 1303 | "vscode-test": "^0.4.1" |
1315 | } | 1304 | } |
1316 | }, | 1305 | }, |
1317 | "vscode-jsonrpc": { | 1306 | "vscode-jsonrpc": { |
1318 | "version": "4.1.0-next.1", | 1307 | "version": "4.1.0-next.2", |
1319 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.1.0-next.1.tgz", | 1308 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.1.0-next.2.tgz", |
1320 | "integrity": "sha512-FzNkvHmg3GXpzZAlnGnpdRbQQX6LDRb0bvc+oxxjMUwIJ66kTO/DyeE2bwU0fsiOEGfsJTCzvjESVl368jZ0/g==" | 1309 | "integrity": "sha512-GsBLjP9DxQ42yl1mW9GEIlnSc0+R8mfzhaebwmmTPEJjezD5SPoAo3DFrIAFZha9yvQ1nzZfZlhtVpGQmgxtXg==" |
1321 | }, | 1310 | }, |
1322 | "vscode-languageclient": { | 1311 | "vscode-languageclient": { |
1323 | "version": "5.3.0-next.4", | 1312 | "version": "5.3.0-next.6", |
1324 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-5.3.0-next.4.tgz", | 1313 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-5.3.0-next.6.tgz", |
1325 | "integrity": "sha512-RODuzXErVpJRSgHv+Xei8fwQtZ/iZOWPCqlLl07NTtkzgTAepJf9r4EioZVuTviGJ5DEJ9xs0bjrit8shKtW6Q==", | 1314 | "integrity": "sha512-DxT8+gkenjCjJV6ArcP75/AQfx6HP6m6kHIbacPCpffMeoE1YMLKj6ZixA9J87yr0fMtBmqumLmDeGe7MIF2bw==", |
1326 | "requires": { | 1315 | "requires": { |
1327 | "semver": "^5.5.0", | 1316 | "semver": "^5.5.0", |
1328 | "vscode-languageserver-protocol": "3.15.0-next.4" | 1317 | "vscode-languageserver-protocol": "^3.15.0-next.6" |
1329 | } | 1318 | } |
1330 | }, | 1319 | }, |
1331 | "vscode-languageserver-protocol": { | 1320 | "vscode-languageserver-protocol": { |
1332 | "version": "3.15.0-next.4", | 1321 | "version": "3.15.0-next.6", |
1333 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.4.tgz", | 1322 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.6.tgz", |
1334 | "integrity": "sha512-4AgisQ8GWa3irdRu3/UNr3brcSSm0oobmoV1eSOnV7JM32lYyXDnSKB7RuTTXvaAjD/0xQJLEGhkyGHS5gbywA==", | 1323 | "integrity": "sha512-/yDpYlWyNs26mM23mT73xmOFsh1iRfgZfBdHmfAxwDKwpQKLoOSqVidtYfxlK/pD3IEKGcAVnT4WXTsguxxAMQ==", |
1335 | "requires": { | 1324 | "requires": { |
1336 | "vscode-jsonrpc": "^4.1.0-next.1", | 1325 | "vscode-jsonrpc": "^4.1.0-next.2", |
1337 | "vscode-languageserver-types": "3.15.0-next.1" | 1326 | "vscode-languageserver-types": "^3.15.0-next.2" |
1338 | } | 1327 | } |
1339 | }, | 1328 | }, |
1340 | "vscode-languageserver-types": { | 1329 | "vscode-languageserver-types": { |
1341 | "version": "3.15.0-next.1", | 1330 | "version": "3.15.0-next.2", |
1342 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0-next.1.tgz", | 1331 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0-next.2.tgz", |
1343 | "integrity": "sha512-R0kzmaI8gOGEoU7b9huYQAzgZzRQ/5Q8HKjsIUdfz0MjXcBZ4tr1ik1So1p1O5kGrI1VTCd22Fw/wI7ECGoIPw==" | 1332 | "integrity": "sha512-2JkrMWWUi2rlVLSo9OFR2PIGUzdiowEM8NgNYiwLKnXTjpwpjjIrJbNNxDik7Rv4oo9KtikcFQZKXbrKilL/MQ==" |
1344 | }, | 1333 | }, |
1345 | "vscode-test": { | 1334 | "vscode-test": { |
1346 | "version": "0.1.5", | 1335 | "version": "0.4.3", |
1347 | "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.1.5.tgz", | 1336 | "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.4.3.tgz", |
1348 | "integrity": "sha512-s+lbF1Dtasc0yXVB9iQTexBe2JK6HJAUJe3fWezHKIjq+xRw5ZwCMEMBaonFIPy7s95qg2HPTRDR5W4h4kbxGw==", | 1337 | "integrity": "sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w==", |
1349 | "dev": true, | 1338 | "dev": true, |
1350 | "requires": { | 1339 | "requires": { |
1351 | "http-proxy-agent": "^2.1.0", | 1340 | "http-proxy-agent": "^2.1.0", |
diff --git a/editors/code/package.json b/editors/code/package.json index ea74ab85a..808dc5dc1 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -25,7 +25,7 @@ | |||
25 | "lint": "tslint --project .", | 25 | "lint": "tslint --project .", |
26 | "test": "node node_modules/vscode/bin/test", | 26 | "test": "node node_modules/vscode/bin/test", |
27 | "prettier": "prettier **/*.{json,ts}", | 27 | "prettier": "prettier **/*.{json,ts}", |
28 | "travis": "npm run compile && npm run test && npm run lint && npm run prettier -- --list-different" | 28 | "travis": "npm run compile && npm run test && npm run lint && npm run prettier -- --write && git diff --exit-code" |
29 | }, | 29 | }, |
30 | "prettier": { | 30 | "prettier": { |
31 | "tabWidth": 4, | 31 | "tabWidth": 4, |
@@ -36,16 +36,16 @@ | |||
36 | "vscode-languageclient": "^5.3.0-next.4" | 36 | "vscode-languageclient": "^5.3.0-next.4" |
37 | }, | 37 | }, |
38 | "devDependencies": { | 38 | "devDependencies": { |
39 | "@types/mocha": "^5.2.6", | 39 | "@types/mocha": "^5.2.7", |
40 | "@types/node": "^10.14.5", | 40 | "@types/node": "^10.14.13", |
41 | "@types/seedrandom": "^2.4.28", | 41 | "@types/seedrandom": "^2.4.28", |
42 | "prettier": "^1.17.0", | 42 | "prettier": "^1.18.2", |
43 | "shx": "^0.3.1", | 43 | "shx": "^0.3.1", |
44 | "tslint": "^5.16.0", | 44 | "tslint": "^5.18.0", |
45 | "tslint-config-prettier": "^1.18.0", | 45 | "tslint-config-prettier": "^1.18.0", |
46 | "typescript": "^3.4.4", | 46 | "typescript": "^3.5.3", |
47 | "vsce": "^1.64.0", | 47 | "vsce": "^1.66.0", |
48 | "vscode": "^1.1.33" | 48 | "vscode": "^1.1.35" |
49 | }, | 49 | }, |
50 | "activationEvents": [ | 50 | "activationEvents": [ |
51 | "onLanguage:rust", | 51 | "onLanguage:rust", |
@@ -238,6 +238,11 @@ | |||
238 | "type": "number", | 238 | "type": "number", |
239 | "default": null, | 239 | "default": null, |
240 | "description": "Number of syntax trees rust-analyzer keeps in memory" | 240 | "description": "Number of syntax trees rust-analyzer keeps in memory" |
241 | }, | ||
242 | "rust-analyzer.displayInlayHints": { | ||
243 | "type": "boolean", | ||
244 | "default": true, | ||
245 | "description": "Display additional type information in the editor" | ||
241 | } | 246 | } |
242 | } | 247 | } |
243 | }, | 248 | }, |
@@ -444,6 +449,15 @@ | |||
444 | "light": "#000000", | 449 | "light": "#000000", |
445 | "highContrast": "#FFFFFF" | 450 | "highContrast": "#FFFFFF" |
446 | } | 451 | } |
452 | }, | ||
453 | { | ||
454 | "id": "ralsp.inlayHint", | ||
455 | "description": "Color for inlay hints", | ||
456 | "defaults": { | ||
457 | "dark": "#A0A0A0F0", | ||
458 | "light": "#747474", | ||
459 | "highContrast": "#BEBEBE" | ||
460 | } | ||
447 | } | 461 | } |
448 | ] | 462 | ] |
449 | } | 463 | } |
diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts index 194658497..c194bd2ea 100644 --- a/editors/code/src/commands/index.ts +++ b/editors/code/src/commands/index.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import * as analyzerStatus from './analyzer_status'; | 1 | import * as analyzerStatus from './analyzer_status'; |
2 | import * as applySourceChange from './apply_source_change'; | 2 | import * as applySourceChange from './apply_source_change'; |
3 | import * as inlayHints from './inlay_hints'; | ||
3 | import * as joinLines from './join_lines'; | 4 | import * as joinLines from './join_lines'; |
4 | import * as matchingBrace from './matching_brace'; | 5 | import * as matchingBrace from './matching_brace'; |
5 | import * as onEnter from './on_enter'; | 6 | import * as onEnter from './on_enter'; |
@@ -15,5 +16,6 @@ export { | |||
15 | parentModule, | 16 | parentModule, |
16 | runnables, | 17 | runnables, |
17 | syntaxTree, | 18 | syntaxTree, |
18 | onEnter | 19 | onEnter, |
20 | inlayHints | ||
19 | }; | 21 | }; |
diff --git a/editors/code/src/commands/inlay_hints.ts b/editors/code/src/commands/inlay_hints.ts new file mode 100644 index 000000000..3ba9da48b --- /dev/null +++ b/editors/code/src/commands/inlay_hints.ts | |||
@@ -0,0 +1,109 @@ | |||
1 | import * as vscode from 'vscode'; | ||
2 | import { Range, TextDocumentChangeEvent, TextEditor } from 'vscode'; | ||
3 | import { TextDocumentIdentifier } from 'vscode-languageclient'; | ||
4 | import { Server } from '../server'; | ||
5 | |||
6 | interface InlayHintsParams { | ||
7 | textDocument: TextDocumentIdentifier; | ||
8 | } | ||
9 | |||
10 | interface InlayHint { | ||
11 | range: Range; | ||
12 | kind: string; | ||
13 | label: string; | ||
14 | } | ||
15 | |||
16 | const typeHintDecorationType = vscode.window.createTextEditorDecorationType({ | ||
17 | after: { | ||
18 | color: new vscode.ThemeColor('ralsp.inlayHint') | ||
19 | } | ||
20 | }); | ||
21 | |||
22 | export class HintsUpdater { | ||
23 | private displayHints = true; | ||
24 | |||
25 | public async loadHints( | ||
26 | editor: vscode.TextEditor | undefined | ||
27 | ): Promise<void> { | ||
28 | if ( | ||
29 | this.displayHints && | ||
30 | editor !== undefined && | ||
31 | this.isRustDocument(editor.document) | ||
32 | ) { | ||
33 | await this.updateDecorationsFromServer( | ||
34 | editor.document.uri.toString(), | ||
35 | editor | ||
36 | ); | ||
37 | } | ||
38 | } | ||
39 | |||
40 | public async toggleHintsDisplay(displayHints: boolean): Promise<void> { | ||
41 | if (this.displayHints !== displayHints) { | ||
42 | this.displayHints = displayHints; | ||
43 | |||
44 | if (displayHints) { | ||
45 | return this.updateHints(); | ||
46 | } else { | ||
47 | const editor = vscode.window.activeTextEditor; | ||
48 | if (editor != null) { | ||
49 | return editor.setDecorations(typeHintDecorationType, []); | ||
50 | } | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | |||
55 | public async updateHints(cause?: TextDocumentChangeEvent): Promise<void> { | ||
56 | if (!this.displayHints) { | ||
57 | return; | ||
58 | } | ||
59 | const editor = vscode.window.activeTextEditor; | ||
60 | if (editor == null) { | ||
61 | return; | ||
62 | } | ||
63 | const document = cause == null ? editor.document : cause.document; | ||
64 | if (!this.isRustDocument(document)) { | ||
65 | return; | ||
66 | } | ||
67 | |||
68 | return await this.updateDecorationsFromServer( | ||
69 | document.uri.toString(), | ||
70 | editor | ||
71 | ); | ||
72 | } | ||
73 | |||
74 | private isRustDocument(document: vscode.TextDocument): boolean { | ||
75 | return document && document.languageId === 'rust'; | ||
76 | } | ||
77 | |||
78 | private async updateDecorationsFromServer( | ||
79 | documentUri: string, | ||
80 | editor: TextEditor | ||
81 | ): Promise<void> { | ||
82 | const newHints = await this.queryHints(documentUri); | ||
83 | if (newHints != null) { | ||
84 | const newDecorations = newHints.map(hint => ({ | ||
85 | range: hint.range, | ||
86 | renderOptions: { after: { contentText: `: ${hint.label}` } } | ||
87 | })); | ||
88 | return editor.setDecorations( | ||
89 | typeHintDecorationType, | ||
90 | newDecorations | ||
91 | ); | ||
92 | } | ||
93 | } | ||
94 | |||
95 | private async queryHints(documentUri: string): Promise<InlayHint[] | null> { | ||
96 | const request: InlayHintsParams = { | ||
97 | textDocument: { uri: documentUri } | ||
98 | }; | ||
99 | const client = Server.client; | ||
100 | return client | ||
101 | .onReady() | ||
102 | .then(() => | ||
103 | client.sendRequest<InlayHint[] | null>( | ||
104 | 'rust-analyzer/inlayHints', | ||
105 | request | ||
106 | ) | ||
107 | ); | ||
108 | } | ||
109 | } | ||
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 3f1b482e3..4d58a1a93 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -21,6 +21,7 @@ export class Config { | |||
21 | public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; | 21 | public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; |
22 | public showWorkspaceLoadedNotification = true; | 22 | public showWorkspaceLoadedNotification = true; |
23 | public lruCapacity: null | number = null; | 23 | public lruCapacity: null | number = null; |
24 | public displayInlayHints = true; | ||
24 | public cargoWatchOptions: CargoWatchOptions = { | 25 | public cargoWatchOptions: CargoWatchOptions = { |
25 | enableOnStartup: 'ask', | 26 | enableOnStartup: 'ask', |
26 | trace: 'off', | 27 | trace: 'off', |
@@ -123,5 +124,9 @@ export class Config { | |||
123 | if (config.has('lruCapacity')) { | 124 | if (config.has('lruCapacity')) { |
124 | this.lruCapacity = config.get('lruCapacity') as number; | 125 | this.lruCapacity = config.get('lruCapacity') as number; |
125 | } | 126 | } |
127 | |||
128 | if (config.has('displayInlayHints')) { | ||
129 | this.displayInlayHints = config.get('displayInlayHints') as boolean; | ||
130 | } | ||
126 | } | 131 | } |
127 | } | 132 | } |
diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts index c8c3004a7..c6efc2e7e 100644 --- a/editors/code/src/extension.ts +++ b/editors/code/src/extension.ts | |||
@@ -3,6 +3,7 @@ import * as lc from 'vscode-languageclient'; | |||
3 | 3 | ||
4 | import * as commands from './commands'; | 4 | import * as commands from './commands'; |
5 | import { CargoWatchProvider } from './commands/cargo_watch'; | 5 | import { CargoWatchProvider } from './commands/cargo_watch'; |
6 | import { HintsUpdater } from './commands/inlay_hints'; | ||
6 | import { | 7 | import { |
7 | interactivelyStartCargoWatch, | 8 | interactivelyStartCargoWatch, |
8 | startCargoWatch | 9 | startCargoWatch |
@@ -147,6 +148,29 @@ export function activate(context: vscode.ExtensionContext) { | |||
147 | 148 | ||
148 | // Start the language server, finally! | 149 | // Start the language server, finally! |
149 | startServer(); | 150 | startServer(); |
151 | |||
152 | if (Server.config.displayInlayHints) { | ||
153 | const hintsUpdater = new HintsUpdater(); | ||
154 | hintsUpdater.loadHints(vscode.window.activeTextEditor).then(() => { | ||
155 | disposeOnDeactivation( | ||
156 | vscode.window.onDidChangeActiveTextEditor(editor => | ||
157 | hintsUpdater.loadHints(editor) | ||
158 | ) | ||
159 | ); | ||
160 | disposeOnDeactivation( | ||
161 | vscode.workspace.onDidChangeTextDocument(e => | ||
162 | hintsUpdater.updateHints(e) | ||
163 | ) | ||
164 | ); | ||
165 | disposeOnDeactivation( | ||
166 | vscode.workspace.onDidChangeConfiguration(_ => | ||
167 | hintsUpdater.toggleHintsDisplay( | ||
168 | Server.config.displayInlayHints | ||
169 | ) | ||
170 | ) | ||
171 | ); | ||
172 | }); | ||
173 | } | ||
150 | } | 174 | } |
151 | 175 | ||
152 | export function deactivate(): Thenable<void> { | 176 | export function deactivate(): Thenable<void> { |