File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -10,22 +10,22 @@ use serde::{de, Deserialize};
1010use stdx:: split_delim;
1111
1212/// Roots and crates that compose this Rust project.
13- #[ derive( Clone , Debug ) ]
13+ #[ derive( Clone , Debug , Eq , PartialEq ) ]
1414pub struct ProjectJson {
1515 pub ( crate ) roots : Vec < Root > ,
1616 pub ( crate ) crates : Vec < Crate > ,
1717}
1818
1919/// A root points to the directory which contains Rust crates. rust-analyzer watches all files in
2020/// all roots. Roots might be nested.
21- #[ derive( Clone , Debug ) ]
21+ #[ derive( Clone , Debug , Eq , PartialEq ) ]
2222pub struct Root {
2323 pub ( crate ) path : AbsPathBuf ,
2424}
2525
2626/// A crate points to the root module of a crate and lists the dependencies of the crate. This is
2727/// useful in creating the crate graph.
28- #[ derive( Clone , Debug ) ]
28+ #[ derive( Clone , Debug , Eq , PartialEq ) ]
2929pub struct Crate {
3030 pub ( crate ) root_module : AbsPathBuf ,
3131 pub ( crate ) edition : Edition ,
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ pub struct Config {
4444 pub root_path : AbsPathBuf ,
4545}
4646
47- #[ derive( Debug , Clone ) ]
47+ #[ derive( Debug , Clone , Eq , PartialEq ) ]
4848pub enum LinkedProject {
4949 ProjectManifest ( ProjectManifest ) ,
5050 InlineJsonProject ( ProjectJson ) ,
Original file line number Diff line number Diff line change @@ -19,11 +19,14 @@ impl GlobalState {
1919 if self . config . lru_capacity != old_config. lru_capacity {
2020 self . analysis_host . update_lru_capacity ( old_config. lru_capacity ) ;
2121 }
22- if self . config . flycheck != old_config. flycheck {
22+ if self . config . linked_projects != old_config. linked_projects {
23+ self . reload ( )
24+ } else if self . config . flycheck != old_config. flycheck {
2325 self . reload_flycheck ( ) ;
2426 }
2527 }
2628 pub ( crate ) fn reload ( & mut self ) {
29+ log:: info!( "reloading projects: {:?}" , self . config. linked_projects) ;
2730 let workspaces = {
2831 if self . config . linked_projects . is_empty ( )
2932 && self . config . notifications . cargo_toml_not_found
You can’t perform that action at this time.
0 commit comments