diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index ceddb2b05..d69f7941d 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -337,6 +337,16 @@ impl GlobalState { | |||
337 | fn on_request(&mut self, request_received: Instant, req: Request) -> Result<()> { | 337 | fn on_request(&mut self, request_received: Instant, req: Request) -> Result<()> { |
338 | self.register_request(&req, request_received); | 338 | self.register_request(&req, request_received); |
339 | 339 | ||
340 | if self.status == Status::Loading { | ||
341 | self.respond(lsp_server::Response::new_err( | ||
342 | req.id, | ||
343 | // FIXME: i32 should impl From<ErrorCode> (from() guarantees lossless conversion) | ||
344 | lsp_server::ErrorCode::ContentModified as i32, | ||
345 | "Rust Analyzer is still loading...".to_owned(), | ||
346 | )); | ||
347 | return Ok(()); | ||
348 | } | ||
349 | |||
340 | RequestDispatcher { req: Some(req), global_state: self } | 350 | RequestDispatcher { req: Some(req), global_state: self } |
341 | .on_sync::<lsp_ext::ReloadWorkspace>(|s, ()| Ok(s.fetch_workspaces()))? | 351 | .on_sync::<lsp_ext::ReloadWorkspace>(|s, ()| Ok(s.fetch_workspaces()))? |
342 | .on_sync::<lsp_ext::JoinLines>(|s, p| handlers::handle_join_lines(s.snapshot(), p))? | 352 | .on_sync::<lsp_ext::JoinLines>(|s, p| handlers::handle_join_lines(s.snapshot(), p))? |