@@ -71,7 +71,9 @@ pub fn main_loop(
7171 config : ServerConfig ,
7272 connection : Connection ,
7373) -> Result < ( ) > {
74- log:: info!( "server_config: {:#?}" , config) ;
74+ let text_document_caps = client_caps. text_document . as_ref ( ) ;
75+ let config = get_config ( & config, text_document_caps) ;
76+ log:: info!( "initial config: {:#?}" , config) ;
7577
7678 // Windows scheduler implements priority boosts: if thread waits for an
7779 // event (like a condvar), and event fires, priority of the thread is
@@ -92,19 +94,16 @@ pub fn main_loop(
9294 SetThreadPriority ( thread, thread_priority_above_normal) ;
9395 }
9496
95- let text_document_caps = client_caps. text_document . as_ref ( ) ;
9697 let mut loop_state = LoopState :: default ( ) ;
9798 let mut world_state = {
98- // TODO: refactor
99- let new_config = get_config ( & config, text_document_caps) ;
10099 // FIXME: support dynamic workspace loading.
101100 let workspaces = {
102101 let mut loaded_workspaces = Vec :: new ( ) ;
103102 for ws_root in & ws_roots {
104103 let workspace = ra_project_model:: ProjectWorkspace :: discover_with_sysroot (
105104 ws_root. as_path ( ) ,
106105 config. with_sysroot ,
107- & config. cargo_features ,
106+ & config. cargo ,
108107 ) ;
109108 match workspace {
110109 Ok ( workspace) => loaded_workspaces. push ( workspace) ,
@@ -114,7 +113,7 @@ pub fn main_loop(
114113 if let Some ( ra_project_model:: CargoTomlNotFoundError { .. } ) =
115114 e. downcast_ref ( )
116115 {
117- if !new_config . notifications . cargo_toml_not_found {
116+ if !config . notifications . cargo_toml_not_found {
118117 continue ;
119118 }
120119 }
@@ -163,7 +162,7 @@ pub fn main_loop(
163162 config. lru_capacity ,
164163 & globs,
165164 Watch ( !config. use_client_watching ) ,
166- new_config ,
165+ config ,
167166 )
168167 } ;
169168
0 commit comments