@@ -82,7 +82,7 @@ By default, a cargo invocation will be constructed for the configured
82
82
targets and features, with the following base command line:
83
83
84
84
`` `bash
85
- cargo check -- quiet -- workspace -- message-format=json -- all-targets
85
+ cargo check -- quiet -- workspace -- message-format=json -- all-targets -- keep-going
86
86
```
87
87
.
88
88
--
@@ -655,12 +655,12 @@ Whether to hide inlay hints for type adjustments outside of `unsafe` blocks.
655
655
--
656
656
Whether to show inlay hints as postfix ops (`.*` instead of `*` , etc).
657
657
--
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 ` )::
659
659
+
660
660
--
661
661
Whether to show const generic parameter name inlay hints.
662
662
--
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 ` )::
664
664
+
665
665
--
666
666
Whether to show generic lifetime parameter name inlay hints.
@@ -1015,6 +1015,104 @@ Show documentation.
1015
1015
--
1016
1016
Whether to insert closing angle brackets when typing an opening angle bracket of a generic argument list.
1017
1017
--
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
+ --
1018
1116
[[rust-analyzer.workspace.symbol.search.kind]]rust-analyzer.workspace.symbol.search.kind (default: `"only_types"` )::
1019
1117
+
1020
1118
--
0 commit comments