@@ -272,11 +272,6 @@ config_data! {
272272 /// The warnings will be indicated by a blue squiggly underline in code
273273 /// and a blue icon in the `Problems Panel`.
274274 diagnostics_warningsAsInfo: Vec <String > = vec![ ] ,
275- /// Enables automatic discovery of projects using the discoverCommand.
276- ///
277- /// Setting this command will result in rust-analyzer starting indexing
278- /// only once a Rust file has been opened.
279- discoverCommand: Option <Vec <String >> = None ,
280275 /// These directories will be ignored by rust-analyzer. They are
281276 /// relative to the workspace root, and globs are not supported. You may
282277 /// also need to add the folders to Code's `files.watcherExclude`.
@@ -441,6 +436,12 @@ config_data! {
441436 /// Whether to insert closing angle brackets when typing an opening angle bracket of a generic argument list.
442437 typing_autoClosingAngleBrackets_enable: bool = false ,
443438
439+ /// Enables automatic discovery of projects using the discoverCommand.
440+ ///
441+ /// Setting this command will result in rust-analyzer starting indexing
442+ /// only once a Rust file has been opened.
443+ workspace_discoverCommand: Option <Vec <String >> = None ,
444+
444445 /// Workspace symbol search kind.
445446 workspace_symbol_search_kind: WorkspaceSymbolSearchKindDef = WorkspaceSymbolSearchKindDef :: OnlyTypes ,
446447 /// Limits the number of items returned from a workspace symbol search (Defaults to 128).
@@ -656,7 +657,7 @@ config_data! {
656657
657658#[ derive( Debug , Clone ) ]
658659pub struct Config {
659- pub ( crate ) discovered_projects : Vec < ProjectManifest > ,
660+ discovered_projects : Vec < ProjectManifest > ,
660661 /// The workspace roots as registered by the LSP client
661662 workspace_roots : Vec < AbsPathBuf > ,
662663 caps : lsp_types:: ClientCapabilities ,
@@ -933,12 +934,10 @@ impl Config {
933934 pub fn add_linked_projects ( & mut self , projects : Vec < ProjectJsonData > ) {
934935 let linked_projects = & mut self . client_config . global . linkedProjects ;
935936
936- let mut new_projects: Vec < _ > =
937- projects. into_iter ( ) . map ( ManifestOrProjectJson :: ProjectJson ) . collect ( ) ;
938-
937+ let new_projects = projects. into_iter ( ) . map ( ManifestOrProjectJson :: ProjectJson ) ;
939938 match linked_projects {
940- Some ( projects) => projects. append ( & mut new_projects) ,
941- None => * linked_projects = Some ( new_projects) ,
939+ Some ( projects) => projects. append ( & mut new_projects. collect :: < Vec < _ > > ( ) ) ,
940+ None => * linked_projects = Some ( new_projects. collect :: < Vec < _ > > ( ) ) ,
942941 }
943942 }
944943
@@ -1322,7 +1321,7 @@ impl Config {
13221321 }
13231322
13241323 pub fn discover_command ( & self ) -> Option < Vec < String > > {
1325- self . discoverCommand ( ) . clone ( )
1324+ self . workspace_discoverCommand ( ) . clone ( )
13261325 }
13271326
13281327 pub fn linked_or_discovered_projects ( & self ) -> Vec < LinkedProject > {
@@ -1589,7 +1588,7 @@ impl Config {
15891588 }
15901589
15911590 pub fn cargo_autoreload_config ( & self ) -> bool {
1592- self . cargo_autoreload ( ) . to_owned ( ) && self . discoverCommand ( ) . is_none ( )
1591+ self . cargo_autoreload ( ) . to_owned ( ) && self . workspace_discoverCommand ( ) . is_none ( )
15931592 }
15941593
15951594 pub fn run_build_scripts ( & self ) -> bool {
0 commit comments