@@ -82,7 +82,7 @@ By default, a cargo invocation will be constructed for the configured
8282targets and features, with the following base command line:
8383
8484`` `bash
85- cargo check -- quiet -- workspace -- message-format=json -- all-targets
85+ cargo check -- quiet -- workspace -- message-format=json -- all-targets -- keep-going
8686```
8787.
8888--
@@ -655,12 +655,12 @@ Whether to hide inlay hints for type adjustments outside of `unsafe` blocks.
655655--
656656Whether to show inlay hints as postfix ops (`.*` instead of `*` , etc).
657657--
658- [[rust-analyzer.inlayHints.genericParameterHints.const.enable]]rust-analyzer.inlayHints.genericParameterHints.const.enable (default: `false ` )::
658+ [[rust-analyzer.inlayHints.genericParameterHints.const.enable]]rust-analyzer.inlayHints.genericParameterHints.const.enable (default: `true ` )::
659659+
660660--
661661Whether to show const generic parameter name inlay hints.
662662--
663- [[rust-analyzer.inlayHints.genericParameterHints.lifetime.enable]]rust-analyzer.inlayHints.genericParameterHints.lifetime.enable (default: `true ` )::
663+ [[rust-analyzer.inlayHints.genericParameterHints.lifetime.enable]]rust-analyzer.inlayHints.genericParameterHints.lifetime.enable (default: `false ` )::
664664+
665665--
666666Whether to show generic lifetime parameter name inlay hints.
@@ -1015,6 +1015,104 @@ Show documentation.
10151015--
10161016Whether to insert closing angle brackets when typing an opening angle bracket of a generic argument list.
10171017--
1018+ [[rust-analyzer.workspace.discoverConfig]]rust-analyzer.workspace.discoverConfig (default: `null` )::
1019+ +
1020+ --
1021+ Enables automatic discovery of projects using [`DiscoverWorkspaceConfig::command`].
1022+
1023+ [`DiscoverWorkspaceConfig` ] also requires setting `progress_label` and `files_to_watch` .
1024+ `progress_label` is used for the title in progress indicators, whereas `files_to_watch`
1025+ is used to determine which build system-specific files should be watched in order to
1026+ reload rust-analyzer.
1027+
1028+ Below is an example of a valid configuration:
1029+ `` `json
1030+ "rust-analyzer.workspace.discoverConfig": {
1031+ "command": [
1032+ "rust-project",
1033+ "develop-json",
1034+ {arg}
1035+ ],
1036+ "progressLabel": "rust-analyzer",
1037+ "filesToWatch": [
1038+ "BUCK",
1039+ ],
1040+ }
1041+ ```
1042+
1043+ ## On `DiscoverWorkspaceConfig::command`
1044+
1045+ **Warning** : This format is provisional and subject to change.
1046+
1047+ [`DiscoverWorkspaceConfig::command`] *must* return a JSON object
1048+ corresponding to `DiscoverProjectData::Finished` :
1049+
1050+ `` `norun
1051+ #[derive(Debug, Clone, Deserialize, Serialize)]
1052+ #[serde(tag = "kind")]
1053+ #[serde(rename_all = "snake_case")]
1054+ enum DiscoverProjectData {
1055+ Finished { buildfile: Utf8PathBuf, project: ProjectJsonData },
1056+ Error { error: String, source: Option<String> },
1057+ Progress { message: String },
1058+ }
1059+ ```
1060+
1061+ As JSON, `DiscoverProjectData::Finished` is:
1062+
1063+ `` `json
1064+ {
1065+ // the internally-tagged representation of the enum.
1066+ "kind": "finished",
1067+ // the file used by a non-Cargo build system to define
1068+ // a package or target.
1069+ "buildfile": "rust-analyzer/BUILD",
1070+ // the contents of a rust-project.json, elided for brevity
1071+ "project": {
1072+ "sysroot": "foo",
1073+ "crates": []
1074+ }
1075+ }
1076+ ```
1077+
1078+ It is encouraged, but not required, to use the other variants on
1079+ `DiscoverProjectData` to provide a more polished end-user experience.
1080+
1081+ `DiscoverWorkspaceConfig::command` may *optionally* include an `{arg}` ,
1082+ which will be substituted with the JSON-serialized form of the following
1083+ enum:
1084+
1085+ `` `norun
1086+ #[derive(PartialEq, Clone, Debug, Serialize)]
1087+ #[serde(rename_all = "camelCase")]
1088+ pub enum DiscoverArgument {
1089+ Path(AbsPathBuf),
1090+ Buildfile(AbsPathBuf),
1091+ }
1092+ ```
1093+
1094+ The JSON representation of `DiscoverArgument::Path` is:
1095+
1096+ `` `json
1097+ {
1098+ "path": "src/main.rs"
1099+ }
1100+ ```
1101+
1102+ Similarly, the JSON representation of `DiscoverArgument::Buildfile` is:
1103+
1104+ ```
1105+ {
1106+ "buildfile": "BUILD"
1107+ }
1108+ ```
1109+
1110+ `DiscoverArgument::Path` is used to find and generate a `rust-project.json` ,
1111+ and therefore, a workspace, whereas `DiscoverArgument::buildfile` is used to
1112+ to update an existing workspace. As a reference for implementors,
1113+ buck2's `rust-project` will likely be useful:
1114+ https://github.com/facebook/buck2/tree/main/integrations/rust-project.
1115+ --
10181116[[rust-analyzer.workspace.symbol.search.kind]]rust-analyzer.workspace.symbol.search.kind (default: `"only_types"` )::
10191117+
10201118--
0 commit comments