File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
src/tools/rust-analyzer/crates/rust-analyzer/src/handlers Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -139,16 +139,26 @@ impl RequestDispatcher<'_> {
139
139
self . on_with_thread_intent :: < true , ALLOW_RETRYING , R > ( ThreadIntent :: Worker , f)
140
140
}
141
141
142
- /// Dispatches a latency-sensitive request onto the thread pool.
142
+ /// Dispatches a latency-sensitive request onto the thread pool. When the VFS is marked not
143
+ /// ready this will return a default constructed [`R::Result`].
143
144
pub ( crate ) fn on_latency_sensitive < const ALLOW_RETRYING : bool , R > (
144
145
& mut self ,
145
146
f : fn ( GlobalStateSnapshot , R :: Params ) -> anyhow:: Result < R :: Result > ,
146
147
) -> & mut Self
147
148
where
148
- R : lsp_types:: request:: Request + ' static ,
149
- R :: Params : DeserializeOwned + panic:: UnwindSafe + Send + fmt:: Debug ,
150
- R :: Result : Serialize ,
149
+ R : lsp_types:: request:: Request <
150
+ Params : DeserializeOwned + panic:: UnwindSafe + Send + fmt:: Debug ,
151
+ Result : Serialize + Default ,
152
+ > + ' static ,
151
153
{
154
+ if !self . global_state . vfs_done {
155
+ if let Some ( lsp_server:: Request { id, .. } ) =
156
+ self . req . take_if ( |it| it. method == R :: METHOD )
157
+ {
158
+ self . global_state . respond ( lsp_server:: Response :: new_ok ( id, R :: Result :: default ( ) ) ) ;
159
+ }
160
+ return self ;
161
+ }
152
162
self . on_with_thread_intent :: < true , ALLOW_RETRYING , R > ( ThreadIntent :: LatencySensitive , f)
153
163
}
154
164
You can’t perform that action at this time.
0 commit comments