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
Add cross-platform compatible launcher for rust-analyzer (bazelbuild#4118)
For vscode users who commit `.code-workspace` or `settings.json`, this
change introduces a cross-platform compatible entrypoint for
rust-analyzer infrastructure. Note that this doesn't mean the binaries
are magically platform agnostic. It just means the two files mentioned
will be compatible on both Unix and Windows platforms if the vscode
config files are source controlled.
@@ -58,18 +107,23 @@ same keys via plugin-specific config files.
58
107
59
108
## Flags
60
109
61
-
Re-runnable at any time. All flags work on any subcommand.
110
+
Re-runnable at any time. Global flags work on any subcommand.
62
111
63
112
| Flag | Effect |
64
113
|---|---|
114
+
|`--workspace <path>`| Workspace root. Defaults to `$BUILD_WORKSPACE_DIRECTORY` (set by `bazel run`). |
65
115
|`--skip-proc-macro-server`| Don't manage the proc-macro key. |
66
116
|`--skip-rustfmt`| Don't manage the formatter key (use host rustfmt). |
67
-
|`--output-user-root <abs-path>`|`--output_user_root` for flycheck's dedicated Bazel server. Required on Windows for non-trivial workspaces (MAX_PATH). |
68
-
|`--cache-dir <abs-path>`| Where discover writes its merged-JSON cache. |
69
117
|`--per-package-workspaces`| Opt in to per-package workspace splitting (see below). |
70
118
71
-
VSCode subcommand also accepts `--dry-run` (preview JSON without writing) and
72
-
`--replace` (overwrite all managed keys, destroying user keys).
119
+
The `vscode` subcommand adds:
120
+
121
+
| Flag | Effect |
122
+
|---|---|
123
+
|`--output <path>`| Settings file to write. Defaults to the unique `*.code-workspace` at the workspace root, falling back to `.vscode/settings.json`. |
124
+
|`--settings-key <key>`| Nest the managed `rust-analyzer.*` keys under this top-level key. Auto-defaults to `settings` for `.code-workspace` outputs. |
125
+
|`--dry-run`| Preview the JSON without writing. |
126
+
|`--replace`| Replace the managed keys instead of merging. With `--settings-key`, only that nested object is replaced — sibling keys (`folders`, `tasks`, `extensions`) survive. |
0 commit comments