diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-07 13:37:10 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-07 13:37:10 +0100 |
commit | 8e900cb4a1c5a4faef801518272d56a5683dd488 (patch) | |
tree | c16e6b7780804c8bd50131731162c6eeeaf99338 /crates | |
parent | 45510ae23da9090027a80c4ff88dc8e7d9f29dbb (diff) | |
parent | dbd760010e3ca7c0ba239b0ae88a5729b93ae7d8 (diff) |
Merge #8397
8397: Return proper error code when server is loading r=matklad a=ceronman
When requests are made to rust-analyzer and the server is still loading, a response error is returned with the code `ContentModified` and text `"Rust Analyzer is still loading..."`. This error code doesn't seem to be the more appropriate for this situation. Using `ServerNotInitialized` seems better.
As this is such a small change, I have not created an issue for it.
Co-authored-by: Manuel Ceron <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index a5655116b..47c6c6d77 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -484,7 +484,7 @@ impl GlobalState { | |||
484 | req.id, | 484 | req.id, |
485 | // FIXME: i32 should impl From<ErrorCode> (from() guarantees lossless conversion) | 485 | // FIXME: i32 should impl From<ErrorCode> (from() guarantees lossless conversion) |
486 | lsp_server::ErrorCode::ContentModified as i32, | 486 | lsp_server::ErrorCode::ContentModified as i32, |
487 | "Rust Analyzer is still loading...".to_owned(), | 487 | "waiting for cargo metadata or cargo check".to_owned(), |
488 | )); | 488 | )); |
489 | return Ok(()); | 489 | return Ok(()); |
490 | } | 490 | } |