Add capabilities tests.

This commit is contained in:
vsrs
2020-06-03 17:35:26 +03:00
parent e35418ceb9
commit 0fe43a124b
3 changed files with 184 additions and 7 deletions

View File

@@ -273,8 +273,8 @@ impl Request for HoverRequest {
pub struct Hover {
#[serde(flatten)]
pub hover: lsp_types::Hover,
#[serde(skip_serializing_if = "Option::is_none")]
pub actions: Option<Vec<CommandLinkGroup>>,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub actions: Vec<CommandLinkGroup>,
}
#[derive(Debug, PartialEq, Clone, Default, Deserialize, Serialize)]

View File

@@ -555,7 +555,7 @@ pub fn handle_hover(
}),
range: Some(range),
},
actions: Some(prepare_hover_actions(&snap, info.info.actions())),
actions: prepare_hover_actions(&snap, info.info.actions()),
};
Ok(Some(hover))
@@ -1170,10 +1170,7 @@ fn show_references_command(
}
fn to_command_link(command: Command, tooltip: String) -> lsp_ext::CommandLink {
lsp_ext::CommandLink {
tooltip: Some(tooltip),
command,
}
lsp_ext::CommandLink { tooltip: Some(tooltip), command }
}
fn show_impl_command_link(