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 <manuel.ceron@jetbrains.com>
This commit is contained in:
bors[bot] 2021-04-07 12:37:10 +00:00 committed by GitHub
commit 8e900cb4a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -484,7 +484,7 @@ impl GlobalState {
req.id,
// FIXME: i32 should impl From<ErrorCode> (from() guarantees lossless conversion)
lsp_server::ErrorCode::ContentModified as i32,
"Rust Analyzer is still loading...".to_owned(),
"waiting for cargo metadata or cargo check".to_owned(),
));
return Ok(());
}