]> git.lizzy.rs Git - rust.git/blob - editors/code/package.json
Merge #4499
[rust.git] / editors / code / package.json
1 {
2     "name": "rust-analyzer",
3     "displayName": "rust-analyzer",
4     "description": "An alternative rust language server to the RLS",
5     "preview": true,
6     "private": true,
7     "icon": "icon.png",
8     "version": "0.4.0-dev",
9     "releaseTag": null,
10     "publisher": "matklad",
11     "repository": {
12         "url": "https://github.com/rust-analyzer/rust-analyzer.git",
13         "type": "git"
14     },
15     "homepage": "https://rust-analyzer.github.io/",
16     "license": "MIT OR Apache-2.0",
17     "keywords": [
18         "rust"
19     ],
20     "categories": [
21         "Programming Languages"
22     ],
23     "engines": {
24         "vscode": "^1.44.0"
25     },
26     "enableProposedApi": true,
27     "scripts": {
28         "vscode:prepublish": "tsc && rollup -c",
29         "package": "vsce package -o rust-analyzer.vsix",
30         "build": "tsc",
31         "watch": "tsc --watch",
32         "lint": "tsfmt --verify && eslint -c .eslintrc.js --ext ts ./src",
33         "fix": " tsfmt -r       && eslint -c .eslintrc.js --ext ts ./src --fix"
34     },
35     "dependencies": {
36         "node-fetch": "^2.6.0",
37         "vscode-languageclient": "7.0.0-next.1"
38     },
39     "devDependencies": {
40         "@rollup/plugin-commonjs": "^11.1.0",
41         "@rollup/plugin-node-resolve": "^7.1.3",
42         "@types/node": "^12.12.39",
43         "@types/node-fetch": "^2.5.7",
44         "@types/vscode": "^1.44.0",
45         "@typescript-eslint/eslint-plugin": "^2.33.0",
46         "@typescript-eslint/parser": "^2.33.0",
47         "eslint": "^6.8.0",
48         "rollup": "^2.10.0",
49         "tslib": "^1.12.0",
50         "typescript": "^3.9.2",
51         "typescript-formatter": "^7.2.2",
52         "vsce": "^1.75.0"
53     },
54     "activationEvents": [
55         "onLanguage:rust",
56         "onCommand:rust-analyzer.analyzerStatus",
57         "onCommand:rust-analyzer.collectGarbage",
58         "workspaceContains:**/Cargo.toml"
59     ],
60     "main": "./out/main",
61     "contributes": {
62         "taskDefinitions": [
63             {
64                 "type": "cargo",
65                 "required": [
66                     "command"
67                 ],
68                 "properties": {
69                     "label": {
70                         "type": "string"
71                     },
72                     "command": {
73                         "type": "string"
74                     },
75                     "args": {
76                         "type": "array",
77                         "items": {
78                             "type": "string"
79                         }
80                     },
81                     "env": {
82                         "type": "object",
83                         "patternProperties": {
84                             ".+": {
85                                 "type": "string"
86                             }
87                         }
88                     }
89                 }
90             }
91         ],
92         "commands": [
93             {
94                 "command": "rust-analyzer.syntaxTree",
95                 "title": "Show Syntax Tree",
96                 "category": "Rust Analyzer"
97             },
98             {
99                 "command": "rust-analyzer.expandMacro",
100                 "title": "Expand macro recursively",
101                 "category": "Rust Analyzer"
102             },
103             {
104                 "command": "rust-analyzer.matchingBrace",
105                 "title": "Find matching brace",
106                 "category": "Rust Analyzer"
107             },
108             {
109                 "command": "rust-analyzer.parentModule",
110                 "title": "Locate parent module",
111                 "category": "Rust Analyzer"
112             },
113             {
114                 "command": "rust-analyzer.joinLines",
115                 "title": "Join lines",
116                 "category": "Rust Analyzer"
117             },
118             {
119                 "command": "rust-analyzer.run",
120                 "title": "Run",
121                 "category": "Rust Analyzer"
122             },
123             {
124                 "command": "rust-analyzer.debug",
125                 "title": "Debug",
126                 "category": "Rust Analyzer"
127             },
128             {
129                 "command": "rust-analyzer.newDebugConfig",
130                 "title": "Generate launch configuration",
131                 "category": "Rust Analyzer"
132             },
133             {
134                 "command": "rust-analyzer.analyzerStatus",
135                 "title": "Status",
136                 "category": "Rust Analyzer"
137             },
138             {
139                 "command": "rust-analyzer.collectGarbage",
140                 "title": "Run garbage collection",
141                 "category": "Rust Analyzer"
142             },
143             {
144                 "command": "rust-analyzer.reload",
145                 "title": "Restart server",
146                 "category": "Rust Analyzer"
147             },
148             {
149                 "command": "rust-analyzer.onEnter",
150                 "title": "Enhanced enter key",
151                 "category": "Rust Analyzer"
152             },
153             {
154                 "command": "rust-analyzer.ssr",
155                 "title": "Structural Search Replace",
156                 "category": "Rust Analyzer"
157             },
158             {
159                 "command": "rust-analyzer.serverVersion",
160                 "title": "Show RA Version",
161                 "category": "Rust Analyzer"
162             }
163         ],
164         "keybindings": [
165             {
166                 "command": "rust-analyzer.parentModule",
167                 "key": "ctrl+shift+u",
168                 "when": "editorTextFocus && editorLangId == rust"
169             },
170             {
171                 "command": "rust-analyzer.matchingBrace",
172                 "key": "ctrl+shift+m",
173                 "when": "editorTextFocus && editorLangId == rust"
174             },
175             {
176                 "command": "rust-analyzer.joinLines",
177                 "key": "ctrl+shift+j",
178                 "when": "editorTextFocus && editorLangId == rust"
179             }
180         ],
181         "configuration": {
182             "type": "object",
183             "title": "Rust Analyzer",
184             "properties": {
185                 "rust-analyzer.diagnostics.enable": {
186                     "type": "boolean",
187                     "default": true,
188                     "markdownDescription": "Whether to show native rust-analyzer diagnostics."
189                 },
190                 "rust-analyzer.lruCapacity": {
191                     "type": [
192                         "null",
193                         "integer"
194                     ],
195                     "default": null,
196                     "minimum": 0,
197                     "exclusiveMinimum": true,
198                     "description": "Number of syntax trees rust-analyzer keeps in memory."
199                 },
200                 "rust-analyzer.files.watcher": {
201                     "type": "string",
202                     "enum": [
203                         "client",
204                         "notify"
205                     ],
206                     "default": "client",
207                     "description": "Controls file watching implementation."
208                 },
209                 "rust-analyzer.files.exclude": {
210                     "type": "array",
211                     "items": {
212                         "type": "string"
213                     },
214                     "default": [],
215                     "description": "Paths to exclude from analysis."
216                 },
217                 "rust-analyzer.notifications.cargoTomlNotFound": {
218                     "type": "boolean",
219                     "default": true,
220                     "markdownDescription": "Whether to show `can't find Cargo.toml` error message"
221                 },
222                 "rust-analyzer.cargo.noDefaultFeatures": {
223                     "type": "boolean",
224                     "default": false,
225                     "markdownDescription": "Do not activate the `default` feature"
226                 },
227                 "rust-analyzer.cargo.allFeatures": {
228                     "type": "boolean",
229                     "default": true,
230                     "description": "Activate all available features"
231                 },
232                 "rust-analyzer.cargo.features": {
233                     "type": "array",
234                     "items": {
235                         "type": "string"
236                     },
237                     "default": [],
238                     "description": "List of features to activate"
239                 },
240                 "rust-analyzer.cargo.loadOutDirsFromCheck": {
241                     "type": "boolean",
242                     "default": false,
243                     "markdownDescription": "Run `cargo check` on startup to get the correct value for package OUT_DIRs"
244                 },
245                 "rust-analyzer.cargo.target": {
246                     "type": [
247                         "null",
248                         "string"
249                     ],
250                     "default": null,
251                     "description": "Specify the compilation target"
252                 },
253                 "rust-analyzer.rustfmt.extraArgs": {
254                     "type": "array",
255                     "items": {
256                         "type": "string"
257                     },
258                     "default": [],
259                     "description": "Additional arguments to rustfmt"
260                 },
261                 "rust-analyzer.rustfmt.overrideCommand": {
262                     "type": [
263                         "null",
264                         "array"
265                     ],
266                     "items": {
267                         "type": "string",
268                         "minItems": 1
269                     },
270                     "default": null,
271                     "markdownDescription": "Advanced option, fully override the command rust-analyzer uses for formatting."
272                 },
273                 "rust-analyzer.checkOnSave.enable": {
274                     "type": "boolean",
275                     "default": true,
276                     "markdownDescription": "Run specified `cargo check` command for diagnostics on save"
277                 },
278                 "rust-analyzer.checkOnSave.extraArgs": {
279                     "type": "array",
280                     "items": {
281                         "type": "string"
282                     },
283                     "markdownDescription": "Extra arguments for `cargo check`",
284                     "default": []
285                 },
286                 "rust-analyzer.checkOnSave.command": {
287                     "type": "string",
288                     "default": "check",
289                     "markdownDescription": "Cargo command to use for `cargo check`"
290                 },
291                 "rust-analyzer.checkOnSave.overrideCommand": {
292                     "type": [
293                         "null",
294                         "array"
295                     ],
296                     "items": {
297                         "type": "string",
298                         "minItems": 1
299                     },
300                     "default": null,
301                     "markdownDescription": "Advanced option, fully override the command rust-analyzer uses for checking. The command should include `--message-format=json` or similar option."
302                 },
303                 "rust-analyzer.checkOnSave.allTargets": {
304                     "type": "boolean",
305                     "default": true,
306                     "markdownDescription": "Check all targets and tests (will be passed as `--all-targets`)"
307                 },
308                 "rust-analyzer.checkOnSave.allFeatures": {
309                     "type": "boolean",
310                     "default": true,
311                     "markdownDescription": "Check with all features (will be passed as `--all-features`)"
312                 },
313                 "rust-analyzer.inlayHints.enable": {
314                     "type": "boolean",
315                     "default": true,
316                     "description": "Disable all inlay hints"
317                 },
318                 "rust-analyzer.inlayHints.typeHints": {
319                     "type": "boolean",
320                     "default": true,
321                     "description": "Whether to show inlay type hints"
322                 },
323                 "rust-analyzer.inlayHints.chainingHints": {
324                     "type": "boolean",
325                     "default": true,
326                     "description": "Whether to show inlay type hints for method chains"
327                 },
328                 "rust-analyzer.inlayHints.parameterHints": {
329                     "type": "boolean",
330                     "default": true,
331                     "description": "Whether to show function parameter name inlay hints at the call site"
332                 },
333                 "rust-analyzer.inlayHints.maxLength": {
334                     "type": [
335                         "null",
336                         "integer"
337                     ],
338                     "default": 20,
339                     "minimum": 0,
340                     "exclusiveMinimum": true,
341                     "description": "Maximum length for inlay hints"
342                 },
343                 "rust-analyzer.completion.addCallParenthesis": {
344                     "type": "boolean",
345                     "default": true,
346                     "description": "Whether to add parenthesis when completing functions"
347                 },
348                 "rust-analyzer.completion.addCallArgumentSnippets": {
349                     "type": "boolean",
350                     "default": true,
351                     "description": "Whether to add argument snippets when completing functions"
352                 },
353                 "rust-analyzer.completion.postfix.enable": {
354                     "type": "boolean",
355                     "default": true,
356                     "markdownDescription": "Whether to show postfix snippets like `dbg`, `if`, `not`, etc."
357                 },
358                 "rust-analyzer.callInfo.full": {
359                     "type": "boolean",
360                     "default": true,
361                     "description": "Show function name and docs in parameter hints"
362                 },
363                 "rust-analyzer.updates.channel": {
364                     "type": "string",
365                     "enum": [
366                         "stable",
367                         "nightly"
368                     ],
369                     "default": "stable",
370                     "markdownEnumDescriptions": [
371                         "`\"stable\"` updates are shipped weekly, they don't contain cutting-edge features from VSCode proposed APIs but have less bugs in general",
372                         "`\"nightly\"` updates are shipped daily (extension updates automatically by downloading artifacts directly from GitHub), they contain cutting-edge features and latest bug fixes. These releases help us get your feedback very quickly and speed up rust-analyzer development **drastically**"
373                     ],
374                     "markdownDescription": "Choose `\"nightly\"` updates to get the latest features and bug fixes every day. While `\"stable\"` releases occur weekly and don't contain cutting-edge features from VSCode proposed APIs"
375                 },
376                 "rust-analyzer.updates.askBeforeDownload": {
377                     "type": "boolean",
378                     "default": true,
379                     "description": "Whether to ask for permission before downloading any files from the Internet"
380                 },
381                 "rust-analyzer.serverPath": {
382                     "type": [
383                         "null",
384                         "string"
385                     ],
386                     "default": null,
387                     "description": "Path to rust-analyzer executable (points to bundled binary by default). If this is set, then \"rust-analyzer.updates.channel\" setting is not used"
388                 },
389                 "rust-analyzer.trace.server": {
390                     "type": "string",
391                     "scope": "window",
392                     "enum": [
393                         "off",
394                         "messages",
395                         "verbose"
396                     ],
397                     "enumDescriptions": [
398                         "No traces",
399                         "Error only",
400                         "Full log"
401                     ],
402                     "default": "off",
403                     "description": "Trace requests to the rust-analyzer"
404                 },
405                 "rust-analyzer.trace.extension": {
406                     "description": "Enable logging of VS Code extensions itself",
407                     "type": "boolean",
408                     "default": false
409                 },
410                 "rust-analyzer.procMacro.enable": {
411                     "description": "Enable Proc macro support, cargo.loadOutDirsFromCheck must be enabled.",
412                     "type": "boolean",
413                     "default": false
414                 },
415                 "rust-analyzer.debug.engine": {
416                     "type": "string",
417                     "enum": [
418                         "auto",
419                         "vadimcn.vscode-lldb",
420                         "ms-vscode.cpptools"
421                     ],
422                     "default": "auto",
423                     "description": "Preferred debug engine.",
424                     "markdownEnumDescriptions": [
425                         "First try to use [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb), if it's not installed try to use [MS C++ tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools).",
426                         "Use [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)",
427                         "Use [MS C++ tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)"
428                     ]
429                 },
430                 "rust-analyzer.debug.sourceFileMap": {
431                     "type": "object",
432                     "description": "Optional source file mappings passed to the debug engine.",
433                     "default": {
434                         "/rustc/<id>": "${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust"
435                     }
436                 },
437                 "rust-analyzer.debug.openDebugPane": {
438                     "description": "Whether to open up the Debug Pane on debugging start.",
439                     "type": "boolean",
440                     "default": false
441                 },
442                 "rust-analyzer.debug.engineSettings": {
443                     "type": "object",
444                     "default": {},
445                     "description": "Optional settings passed to the debug engine. Example:\n{ \"lldb\": { \"terminal\":\"external\"} }"
446                 },
447                 "rust-analyzer.lens.enable": {
448                     "description": "Whether to show CodeLens in Rust files.",
449                     "type": "boolean",
450                     "default": true
451                 },
452                 "rust-analyzer.lens.run": {
453                     "markdownDescription": "Whether to show Run lens. Only applies when `#rust-analyzer.lens.enable#` is set.",
454                     "type": "boolean",
455                     "default": true
456                 },
457                 "rust-analyzer.lens.debug": {
458                     "markdownDescription": "Whether to show Debug lens. Only applies when `#rust-analyzer.lens.enable#` is set.",
459                     "type": "boolean",
460                     "default": true
461                 },
462                 "rust-analyzer.lens.implementations": {
463                     "markdownDescription": "Whether to show Implementations lens. Only applies when `#rust-analyzer.lens.enable#` is set.",
464                     "type": "boolean",
465                     "default": true
466                 }
467             }
468         },
469         "problemPatterns": [
470             {
471                 "name": "rustc",
472                 "patterns": [
473                     {
474                         "regexp": "^(warning|warn|error)(?:\\[(.*?)\\])?: (.*)$",
475                         "severity": 1,
476                         "code": 2,
477                         "message": 3
478                     },
479                     {
480                         "regexp": "^[\\s->=]*(.*?):(\\d*):(\\d*)\\s*$",
481                         "file": 1,
482                         "line": 2,
483                         "column": 3
484                     }
485                 ]
486             },
487             {
488                 "name": "rustc-json",
489                 "patterns": [
490                     {
491                         "regexp": "^.*\"message\":{\"message\":\"([^\"]*).*?\"file_name\":\"([^\"]+).*?\"line_start\":(\\d+).*?\"line_end\":(\\d+).*?\"column_start\":(\\d+).*?\"column_end\":(\\d+).*}$",
492                         "message": 1,
493                         "file": 2,
494                         "line": 3,
495                         "endLine": 4,
496                         "column": 5,
497                         "endColumn": 6
498                     }
499                 ]
500             }
501         ],
502         "languages": [
503             {
504                 "id": "ra_syntax_tree",
505                 "extensions": [
506                     ".rast"
507                 ]
508             }
509         ],
510         "grammars": [
511             {
512                 "language": "rust",
513                 "scopeName": "source.rust",
514                 "path": "rust.tmGrammar.json"
515             },
516             {
517                 "language": "ra_syntax_tree",
518                 "scopeName": "source.ra_syntax_tree",
519                 "path": "ra_syntax_tree.tmGrammar.json"
520             }
521         ],
522         "problemMatchers": [
523             {
524                 "name": "rustc",
525                 "fileLocation": [
526                     "relative",
527                     "${workspaceRoot}"
528                 ],
529                 "pattern": "$rustc"
530             },
531             {
532                 "name": "rustc-json",
533                 "fileLocation": [
534                     "relative",
535                     "${workspaceRoot}"
536                 ],
537                 "pattern": "$rustc-json"
538             },
539             {
540                 "name": "rustc-watch",
541                 "fileLocation": [
542                     "relative",
543                     "${workspaceRoot}"
544                 ],
545                 "background": {
546                     "beginsPattern": "^\\[Running\\b",
547                     "endsPattern": "^\\[Finished running\\b"
548                 },
549                 "pattern": "$rustc"
550             }
551         ],
552         "colors": [
553             {
554                 "id": "rust_analyzer.inlayHint",
555                 "description": "Color for inlay hints",
556                 "defaults": {
557                     "dark": "#A0A0A0F0",
558                     "light": "#747474",
559                     "highContrast": "#BEBEBE"
560                 }
561             },
562             {
563                 "id": "rust_analyzer.syntaxTreeBorder",
564                 "description": "Color of the border displayed in the Rust source code for the selected syntax node (see \"Show Syntax Tree\" command)",
565                 "defaults": {
566                     "dark": "#ffffff",
567                     "light": "#b700ff",
568                     "highContrast": "#b700ff"
569                 }
570             }
571         ],
572         "semanticTokenTypes": [
573             {
574                 "id": "attribute",
575                 "description": "Style for attributes"
576             },
577             {
578                 "id": "builtinType",
579                 "description": "Style for builtin types",
580                 "superType": "type"
581             },
582             {
583                 "id": "lifetime",
584                 "description": "Style for lifetimes"
585             },
586             {
587                 "id": "typeAlias",
588                 "description": "Style for type aliases",
589                 "superType": "type"
590             },
591             {
592                 "id": "union",
593                 "description": "Style for C-style untagged unions",
594                 "superType": "type"
595             },
596             {
597                 "id": "unresolvedReference",
598                 "description": "Style for names which can not be resolved due to compilation errors"
599             },
600             {
601                 "id": "formatSpecifier",
602                 "description": "Style for {} placeholders in format strings"
603             }
604         ],
605         "semanticTokenModifiers": [
606             {
607                 "id": "constant",
608                 "description": "Style for compile-time constants"
609             },
610             {
611                 "id": "controlFlow",
612                 "description": "Style for control flow keywords"
613             },
614             {
615                 "id": "mutable",
616                 "description": "Style for mutable bindings"
617             },
618             {
619                 "id": "unsafe",
620                 "description": "Style for unsafe operations"
621             }
622         ],
623         "semanticTokenScopes": [
624             {
625                 "language": "rust",
626                 "scopes": {
627                     "macro": [
628                         "entity.name.function.macro.rust"
629                     ],
630                     "attribute": [
631                         "meta.attribute.rust"
632                     ],
633                     "builtinType": [
634                         "support.type.primitive.rust"
635                     ],
636                     "lifetime": [
637                         "storage.modifier.lifetime.rust"
638                     ],
639                     "typeAlias": [
640                         "entity.name.type.typeAlias.rust"
641                     ],
642                     "union": [
643                         "entity.name.type.union.rust"
644                     ],
645                     "struct": [
646                         "entity.name.type.struct.rust"
647                     ],
648                     "keyword": [
649                         "keyword.other.rust"
650                     ],
651                     "keyword.controlFlow": [
652                         "keyword.control.rust"
653                     ],
654                     "variable.constant": [
655                         "variable.other.constant.rust"
656                     ],
657                     "formatSpecifier": [
658                         "punctuation.section.embedded.rust"
659                     ],
660                     "*.mutable": [
661                         "markup.underline"
662                     ]
663                 }
664             }
665         ]
666     }
667 }