Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ impl LanguageServer for Backend {
}

async fn shutdown(&self) -> Result<()> {
// tower-lsp's `serve` doesn't return on `exit`: it only finishes once
// stdin closes. Clients like Neovim send `exit` but keep stdin open
// until the process quits, so they'd wait forever. `exit` is the only
// valid message after `shutdown`, so leave once the reply has been
// written.
tokio::spawn(async {
tokio::time::sleep(Duration::from_millis(200)).await;
std::process::exit(0);
});

Ok(())
}

Expand Down