|
|
@ -123,6 +123,8 @@ pub mod util {
|
|
|
|
#[derive(Debug, PartialEq, Clone)]
|
|
|
|
#[derive(Debug, PartialEq, Clone)]
|
|
|
|
pub enum Notification {
|
|
|
|
pub enum Notification {
|
|
|
|
PublishDiagnostics(lsp::PublishDiagnosticsParams),
|
|
|
|
PublishDiagnostics(lsp::PublishDiagnosticsParams),
|
|
|
|
|
|
|
|
ShowMessage(lsp::ShowMessageParams),
|
|
|
|
|
|
|
|
LogMessage(lsp::LogMessageParams),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl Notification {
|
|
|
|
impl Notification {
|
|
|
@ -138,6 +140,19 @@ impl Notification {
|
|
|
|
// TODO: need to loop over diagnostics and distinguish them by URI
|
|
|
|
// TODO: need to loop over diagnostics and distinguish them by URI
|
|
|
|
Notification::PublishDiagnostics(params)
|
|
|
|
Notification::PublishDiagnostics(params)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lsp::notification::ShowMessage::METHOD => {
|
|
|
|
|
|
|
|
let params: lsp::ShowMessageParams =
|
|
|
|
|
|
|
|
params.parse().expect("Failed to parse ShowMessage params");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notification::ShowMessage(params)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
lsp::notification::LogMessage::METHOD => {
|
|
|
|
|
|
|
|
let params: lsp::LogMessageParams =
|
|
|
|
|
|
|
|
params.parse().expect("Failed to parse ShowMessage params");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notification::LogMessage(params)
|
|
|
|
|
|
|
|
}
|
|
|
|
_ => unimplemented!("unhandled notification: {}", method),
|
|
|
|
_ => unimplemented!("unhandled notification: {}", method),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|