aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-05-08 09:17:13 +0000
committerBlaž Hrastnik2021-05-08 09:17:13 +0000
commitcaf434992563cbdedeccb5574af16091e987f365 (patch)
treef36feef8de909e4a698444fb10c672f2052972a3 /helix-term/src
parentd24844b73db61e50e1d6fed898d3ff2ba8731356 (diff)
Remove some of the panics, just log instead.
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/application.rs6
-rw-r--r--helix-term/src/commands.rs9
2 files changed, 11 insertions, 4 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index ae7e22bd..42a46f1e 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -145,7 +145,11 @@ impl Application {
use helix_lsp::{Call, Notification};
match call {
Call::Notification(helix_lsp::jsonrpc::Notification { method, params, .. }) => {
- let notification = Notification::parse(&method, params);
+ let notification = match Notification::parse(&method, params) {
+ Some(notification) => notification,
+ None => return,
+ };
+
// TODO: parse should return Result/Option
match notification {
Notification::PublishDiagnostics(params) => {
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 959bd7d5..59425670 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1883,7 +1883,8 @@ pub fn format_selections(cx: &mut Context) {
};
// TODO: handle fails
// TODO: concurrent map
- unimplemented!(); // neeed to block to get the formatting
+
+ // TODO: need to block to get the formatting
// let edits = block_on(language_server.text_document_range_formatting(
// doc.identifier(),
@@ -2098,10 +2099,12 @@ pub fn hover(cx: &mut Context) {
lsp::HoverContents::Scalar(contents) => {
// markedstring(string/languagestring to be highlighted)
// TODO
- unimplemented!("{:?}", contents)
+ log::error!("hover contents {:?}", contents);
+ return;
}
lsp::HoverContents::Array(contents) => {
- unimplemented!("{:?}", contents)
+ log::error!("hover contents {:?}", contents);
+ return;
}
// TODO: render markdown
lsp::HoverContents::Markup(contents) => contents.value,