@@ -19,7 +19,7 @@ use triomphe::Arc;
19
19
use vfs:: AnchoredPathBuf ;
20
20
21
21
use crate :: {
22
- config:: Config ,
22
+ config:: { Config , ConfigError } ,
23
23
diagnostics:: { CheckFixes , DiagnosticCollection } ,
24
24
from_proto,
25
25
line_index:: { LineEndings , LineIndex } ,
@@ -52,24 +52,33 @@ pub(crate) type ReqQueue = lsp_server::ReqQueue<(String, Instant), ReqHandler>;
52
52
pub ( crate ) struct GlobalState {
53
53
sender : Sender < lsp_server:: Message > ,
54
54
req_queue : ReqQueue ,
55
+
55
56
pub ( crate ) task_pool : Handle < TaskPool < Task > , Receiver < Task > > ,
56
- pub ( crate ) loader : Handle < Box < dyn vfs :: loader :: Handle > , Receiver < vfs :: loader :: Message > > ,
57
+
57
58
pub ( crate ) config : Arc < Config > ,
59
+ pub ( crate ) config_errors : Option < ConfigError > ,
58
60
pub ( crate ) analysis_host : AnalysisHost ,
59
61
pub ( crate ) diagnostics : DiagnosticCollection ,
60
62
pub ( crate ) mem_docs : MemDocs ,
63
+ pub ( crate ) source_root_config : SourceRootConfig ,
61
64
pub ( crate ) semantic_tokens_cache : Arc < Mutex < FxHashMap < Url , SemanticTokens > > > ,
65
+
66
+ // status
62
67
pub ( crate ) shutdown_requested : bool ,
63
68
pub ( crate ) last_reported_status : Option < lsp_ext:: ServerStatusParams > ,
64
- pub ( crate ) source_root_config : SourceRootConfig ,
65
69
70
+ // proc macros
66
71
pub ( crate ) proc_macro_changed : bool ,
67
72
pub ( crate ) proc_macro_clients : Arc < [ anyhow:: Result < ProcMacroServer > ] > ,
68
73
74
+ // Flycheck
69
75
pub ( crate ) flycheck : Arc < [ FlycheckHandle ] > ,
70
76
pub ( crate ) flycheck_sender : Sender < flycheck:: Message > ,
71
77
pub ( crate ) flycheck_receiver : Receiver < flycheck:: Message > ,
78
+ pub ( crate ) last_flycheck_error : Option < String > ,
72
79
80
+ // VFS
81
+ pub ( crate ) loader : Handle < Box < dyn vfs:: loader:: Handle > , Receiver < vfs:: loader:: Message > > ,
73
82
pub ( crate ) vfs : Arc < RwLock < ( vfs:: Vfs , IntMap < FileId , LineEndings > ) > > ,
74
83
pub ( crate ) vfs_config_version : u32 ,
75
84
pub ( crate ) vfs_progress_config_version : u32 ,
@@ -102,11 +111,12 @@ pub(crate) struct GlobalState {
102
111
/// the user just adds comments or whitespace to Cargo.toml, we do not want
103
112
/// to invalidate any salsa caches.
104
113
pub ( crate ) workspaces : Arc < Vec < ProjectWorkspace > > ,
114
+
115
+ // op queues
105
116
pub ( crate ) fetch_workspaces_queue : OpQueue < ( ) , Option < Vec < anyhow:: Result < ProjectWorkspace > > > > ,
106
117
pub ( crate ) fetch_build_data_queue :
107
118
OpQueue < ( ) , ( Arc < Vec < ProjectWorkspace > > , Vec < anyhow:: Result < WorkspaceBuildScripts > > ) > ,
108
119
pub ( crate ) fetch_proc_macros_queue : OpQueue < Vec < ProcMacroPaths > , bool > ,
109
-
110
120
pub ( crate ) prime_caches_queue : OpQueue ,
111
121
}
112
122
@@ -160,6 +170,7 @@ impl GlobalState {
160
170
shutdown_requested : false ,
161
171
last_reported_status : None ,
162
172
source_root_config : SourceRootConfig :: default ( ) ,
173
+ config_errors : Default :: default ( ) ,
163
174
164
175
proc_macro_changed : false ,
165
176
// FIXME: use `Arc::from_iter` when it becomes available
@@ -169,6 +180,7 @@ impl GlobalState {
169
180
flycheck : Arc :: from ( Vec :: new ( ) ) ,
170
181
flycheck_sender,
171
182
flycheck_receiver,
183
+ last_flycheck_error : None ,
172
184
173
185
vfs : Arc :: new ( RwLock :: new ( ( vfs:: Vfs :: default ( ) , IntMap :: default ( ) ) ) ) ,
174
186
vfs_config_version : 0 ,
0 commit comments