Skip to content

Commit 6144784

Browse files
committed
Let shutdown request to pass through when status == Loading
1 parent e43811c commit 6144784

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/rust-analyzer/src/main_loop.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,10 @@ impl GlobalState {
337337
fn on_request(&mut self, request_received: Instant, req: Request) -> Result<()> {
338338
self.register_request(&req, request_received);
339339

340-
if self.status == Status::Loading {
340+
if self.status == Status::Loading && req.method !== "shutdown" {
341341
self.respond(lsp_server::Response::new_err(
342342
req.id,
343-
// FIXME: i32 should impl From<ErrorCode> (from() guarantees lossless conversion)
343+
// FIXME: i32 should impl From<ErrorCode> (from() guarantees lossless conversion)
344344
lsp_server::ErrorCode::ContentModified as i32,
345345
"Rust Analyzer is still loading...".to_owned(),
346346
));
@@ -405,6 +405,8 @@ impl GlobalState {
405405
.on::<lsp_ext::Ssr>(handlers::handle_ssr)?
406406
.finish();
407407
Ok(())
408+
}
409+
}
408410
}
409411
fn on_notification(&mut self, not: Notification) -> Result<()> {
410412
NotificationDispatcher { not: Some(not), global_state: self }

0 commit comments

Comments
 (0)