Skip to content

Commit ed3695a

Browse files
author
Junfeng Li
committed
window/showMessage.
Close #423.
1 parent f3d4131 commit ed3695a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/languageclient.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,6 +1700,15 @@ impl State {
17001700
Ok(())
17011701
}
17021702

1703+
pub fn window_showMessage(&mut self, params: &Option<Params>) -> Result<()> {
1704+
info!("Begin {}", lsp::notification::ShowMessage::METHOD);
1705+
let params: ShowMessageParams = params.clone().to_lsp()?;
1706+
let msg = format!("[{:?}] {}", params.typ, params.message);
1707+
self.echomsg(&msg)?;
1708+
info!("End {}", lsp::notification::ShowMessage::METHOD);
1709+
Ok(())
1710+
}
1711+
17031712
pub fn client_registerCapability(
17041713
&mut self,
17051714
_languageId: &str,

src/rpchandler.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ impl State {
136136
self.textDocument_publishDiagnostics(&notification.params)?
137137
}
138138
lsp::notification::LogMessage::METHOD => self.window_logMessage(&notification.params)?,
139+
lsp::notification::ShowMessage::METHOD => {
140+
self.window_showMessage(&notification.params)?
141+
}
139142
lsp::notification::Exit::METHOD => self.exit(&notification.params)?,
140143
// Extensions.
141144
NOTIFICATION__HandleBufReadPost => {

0 commit comments

Comments
 (0)