@@ -535,7 +535,7 @@ impl Default for ConfigData {
535535
536536#[ derive( Debug , Clone ) ]
537537pub struct Config {
538- discovered_projects : Option < Vec < ProjectManifest > > ,
538+ discovered_projects : Vec < ProjectManifest > ,
539539 /// The workspace roots as registered by the LSP client
540540 workspace_roots : Vec < AbsPathBuf > ,
541541 caps : lsp_types:: ClientCapabilities ,
@@ -743,7 +743,7 @@ impl Config {
743743 caps,
744744 data : ConfigData :: default ( ) ,
745745 detached_files : Vec :: new ( ) ,
746- discovered_projects : None ,
746+ discovered_projects : Vec :: new ( ) ,
747747 root_path,
748748 snippets : Default :: default ( ) ,
749749 workspace_roots,
@@ -756,7 +756,7 @@ impl Config {
756756 if discovered. is_empty ( ) {
757757 tracing:: error!( "failed to find any projects in {:?}" , & self . workspace_roots) ;
758758 }
759- self . discovered_projects = Some ( discovered) ;
759+ self . discovered_projects = discovered;
760760 }
761761
762762 pub fn remove_workspace ( & mut self , path : & AbsPath ) {
@@ -871,25 +871,19 @@ impl Config {
871871 pub fn linked_projects ( & self ) -> Vec < LinkedProject > {
872872 match self . data . linkedProjects . as_slice ( ) {
873873 [ ] => {
874- match self . discovered_projects . as_ref ( ) {
875- Some ( discovered_projects) => {
876- let exclude_dirs: Vec < _ > = self
877- . data
878- . files_excludeDirs
879- . iter ( )
880- . map ( |p| self . root_path . join ( p) )
881- . collect ( ) ;
882- discovered_projects
883- . iter ( )
884- . filter ( |( ProjectManifest :: ProjectJson ( path) | ProjectManifest :: CargoToml ( path) ) | {
874+ let exclude_dirs: Vec < _ > =
875+ self . data . files_excludeDirs . iter ( ) . map ( |p| self . root_path . join ( p) ) . collect ( ) ;
876+ self . discovered_projects
877+ . iter ( )
878+ . filter (
879+ |( ProjectManifest :: ProjectJson ( path)
880+ | ProjectManifest :: CargoToml ( path) ) | {
885881 !exclude_dirs. iter ( ) . any ( |p| path. starts_with ( p) )
886- } )
887- . cloned ( )
888- . map ( LinkedProject :: from)
889- . collect ( )
890- }
891- None => Vec :: new ( ) ,
892- }
882+ } ,
883+ )
884+ . cloned ( )
885+ . map ( LinkedProject :: from)
886+ . collect ( )
893887 }
894888 linked_projects => linked_projects
895889 . iter ( )
0 commit comments