You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit add Cargo-style project discovery for Buck and Bazel users.
This feature requires the user to add a command that generates a
`rust-project.json` from a set of files. Project discovery can be invoked
in two ways:
1. At extension activation time, which includes the generated
`rust-project.json` as part of the linkedProjects argument in
InitializeParams
2. Through a new command titled "Add current file to workspace", which
makes use of a new, rust-analyzer specific LSP request that adds
the workspace without erasing any existing workspaces.
I think that the command-running functionality _could_ merit being
placed into its own extension (and expose it via extension contribution
points), if only provide build-system idiomatic progress reporting and
status handling, but I haven't (yet) made an extension that does this.
Copy file name to clipboardExpand all lines: editors/code/package.json
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,11 @@
199
199
"title": "Reload workspace",
200
200
"category": "rust-analyzer"
201
201
},
202
+
{
203
+
"command": "rust-analyzer.addProject",
204
+
"title": "Add current file to workspace",
205
+
"category": "rust-analyzer"
206
+
},
202
207
{
203
208
"command": "rust-analyzer.reload",
204
209
"title": "Restart server",
@@ -447,6 +452,17 @@
447
452
"Fill missing expressions with reasonable defaults, `new` or `default` constructors."
448
453
]
449
454
},
455
+
"rust-analyzer.discoverProjectCommand": {
456
+
"markdownDescription": "Sets the command that rust-analyzer uses to generate `rust-project.json` files. This command is\n only suggested if a build system like Buck or Bazel is used. The command must accept files as arguements and return \n a rust-project.json over stdout.",
457
+
"default": null,
458
+
"type": [
459
+
"null",
460
+
"array"
461
+
],
462
+
"items": {
463
+
"type": "string"
464
+
}
465
+
},
450
466
"rust-analyzer.cachePriming.enable": {
451
467
"markdownDescription": "Warm up caches on project load.",
0 commit comments