Let shutdown request to pass through when status == Loading

This commit is contained in:
Veetaha 2020-08-10 00:41:48 +03:00
parent e43811c164
commit dbe7ede2ee

View file

@ -337,7 +337,7 @@ impl GlobalState {
fn on_request(&mut self, request_received: Instant, req: Request) -> Result<()> { fn on_request(&mut self, request_received: Instant, req: Request) -> Result<()> {
self.register_request(&req, request_received); self.register_request(&req, request_received);
if self.status == Status::Loading { if self.status == Status::Loading && req.method != "shutdown" {
self.respond(lsp_server::Response::new_err( self.respond(lsp_server::Response::new_err(
req.id, req.id,
// FIXME: i32 should impl From<ErrorCode> (from() guarantees lossless conversion) // FIXME: i32 should impl From<ErrorCode> (from() guarantees lossless conversion)