Switch to LSP inlay hints

This commit is contained in:
Laurențiu Nicola
2022-04-08 13:20:21 +03:00
parent bc56920757
commit d3d6267112
11 changed files with 76 additions and 223 deletions

View File

@@ -236,14 +236,6 @@ pub struct TestInfo {
pub runnable: Runnable,
}
pub enum InlayHints {}
impl Request for InlayHints {
type Params = InlayHintsParams;
type Result = Vec<InlayHint>;
const METHOD: &'static str = "experimental/inlayHints";
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct InlayHintsParams {
@@ -251,44 +243,6 @@ pub struct InlayHintsParams {
pub range: Option<lsp_types::Range>,
}
#[derive(Eq, PartialEq, Debug, Copy, Clone, Serialize, Deserialize)]
#[serde(transparent)]
pub struct InlayHintKind(u8);
impl InlayHintKind {
pub const TYPE: InlayHintKind = InlayHintKind(1);
pub const PARAMETER: InlayHintKind = InlayHintKind(2);
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct InlayHint {
pub label: InlayHintLabel,
pub position: Position,
pub kind: Option<InlayHintKind>,
pub tooltip: Option<String>,
pub padding_left: Option<bool>,
pub padding_right: Option<bool>,
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum InlayHintLabel {
String(String),
Parts(Vec<InlayHintLabelPart>),
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct InlayHintLabelPart {
pub value: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub tooltip: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<lsp_types::LocationLink>,
#[serde(skip_serializing_if = "Option::is_none")]
pub command: Option<lsp_types::Command>,
}
pub enum Ssr {}
impl Request for Ssr {