@@ -19,7 +19,7 @@ use triomphe::Arc;
1919use vfs:: AnchoredPathBuf ;
2020
2121use crate :: {
22- config:: Config ,
22+ config:: { Config , ConfigError } ,
2323 diagnostics:: { CheckFixes , DiagnosticCollection } ,
2424 from_proto,
2525 line_index:: { LineEndings , LineIndex } ,
@@ -52,24 +52,33 @@ pub(crate) type ReqQueue = lsp_server::ReqQueue<(String, Instant), ReqHandler>;
5252pub ( crate ) struct GlobalState {
5353 sender : Sender < lsp_server:: Message > ,
5454 req_queue : ReqQueue ,
55+
5556 pub ( crate ) task_pool : Handle < TaskPool < Task > , Receiver < Task > > ,
56- pub ( crate ) loader : Handle < Box < dyn vfs :: loader :: Handle > , Receiver < vfs :: loader :: Message > > ,
57+
5758 pub ( crate ) config : Arc < Config > ,
59+ pub ( crate ) config_errors : Option < ConfigError > ,
5860 pub ( crate ) analysis_host : AnalysisHost ,
5961 pub ( crate ) diagnostics : DiagnosticCollection ,
6062 pub ( crate ) mem_docs : MemDocs ,
63+ pub ( crate ) source_root_config : SourceRootConfig ,
6164 pub ( crate ) semantic_tokens_cache : Arc < Mutex < FxHashMap < Url , SemanticTokens > > > ,
65+
66+ // status
6267 pub ( crate ) shutdown_requested : bool ,
6368 pub ( crate ) last_reported_status : Option < lsp_ext:: ServerStatusParams > ,
64- pub ( crate ) source_root_config : SourceRootConfig ,
6569
70+ // proc macros
6671 pub ( crate ) proc_macro_changed : bool ,
6772 pub ( crate ) proc_macro_clients : Arc < [ anyhow:: Result < ProcMacroServer > ] > ,
6873
74+ // Flycheck
6975 pub ( crate ) flycheck : Arc < [ FlycheckHandle ] > ,
7076 pub ( crate ) flycheck_sender : Sender < flycheck:: Message > ,
7177 pub ( crate ) flycheck_receiver : Receiver < flycheck:: Message > ,
78+ pub ( crate ) last_flycheck_error : Option < String > ,
7279
80+ // VFS
81+ pub ( crate ) loader : Handle < Box < dyn vfs:: loader:: Handle > , Receiver < vfs:: loader:: Message > > ,
7382 pub ( crate ) vfs : Arc < RwLock < ( vfs:: Vfs , IntMap < FileId , LineEndings > ) > > ,
7483 pub ( crate ) vfs_config_version : u32 ,
7584 pub ( crate ) vfs_progress_config_version : u32 ,
@@ -102,11 +111,12 @@ pub(crate) struct GlobalState {
102111 /// the user just adds comments or whitespace to Cargo.toml, we do not want
103112 /// to invalidate any salsa caches.
104113 pub ( crate ) workspaces : Arc < Vec < ProjectWorkspace > > ,
114+
115+ // op queues
105116 pub ( crate ) fetch_workspaces_queue : OpQueue < ( ) , Option < Vec < anyhow:: Result < ProjectWorkspace > > > > ,
106117 pub ( crate ) fetch_build_data_queue :
107118 OpQueue < ( ) , ( Arc < Vec < ProjectWorkspace > > , Vec < anyhow:: Result < WorkspaceBuildScripts > > ) > ,
108119 pub ( crate ) fetch_proc_macros_queue : OpQueue < Vec < ProcMacroPaths > , bool > ,
109-
110120 pub ( crate ) prime_caches_queue : OpQueue ,
111121}
112122
@@ -160,6 +170,7 @@ impl GlobalState {
160170 shutdown_requested : false ,
161171 last_reported_status : None ,
162172 source_root_config : SourceRootConfig :: default ( ) ,
173+ config_errors : Default :: default ( ) ,
163174
164175 proc_macro_changed : false ,
165176 // FIXME: use `Arc::from_iter` when it becomes available
@@ -169,6 +180,7 @@ impl GlobalState {
169180 flycheck : Arc :: from ( Vec :: new ( ) ) ,
170181 flycheck_sender,
171182 flycheck_receiver,
183+ last_flycheck_error : None ,
172184
173185 vfs : Arc :: new ( RwLock :: new ( ( vfs:: Vfs :: default ( ) , IntMap :: default ( ) ) ) ) ,
174186 vfs_config_version : 0 ,
0 commit comments