Expose more errors from rust-analyzer on invalid Cargo.toml contents (#8356)
Release Notes: - Fixed ([#7574](https://github.com/zed-industries/zed/issues/7574)).
This commit is contained in:
parent
0903062933
commit
6fcd57ac53
3 changed files with 74 additions and 1 deletions
|
@ -164,6 +164,34 @@ struct Error {
|
|||
message: String,
|
||||
}
|
||||
|
||||
/// Experimental: Informs the end user about the state of the server
|
||||
///
|
||||
/// [Rust Analyzer Specification](https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.md#server-status)
|
||||
#[derive(Debug)]
|
||||
pub enum ServerStatus {}
|
||||
|
||||
/// Other(String) variant to handle unknown values due to this still being experimental
|
||||
#[derive(Debug, PartialEq, Deserialize, Serialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum ServerHealthStatus {
|
||||
Ok,
|
||||
Warning,
|
||||
Error,
|
||||
Other(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Deserialize, Serialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ServerStatusParams {
|
||||
pub health: ServerHealthStatus,
|
||||
pub message: Option<String>,
|
||||
}
|
||||
|
||||
impl lsp_types::notification::Notification for ServerStatus {
|
||||
type Params = ServerStatusParams;
|
||||
const METHOD: &'static str = "experimental/serverStatus";
|
||||
}
|
||||
|
||||
impl LanguageServer {
|
||||
/// Starts a language server process.
|
||||
pub fn new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue