Add experimental VSCode api

This commit is contained in:
Kirill Bulatov
2021-02-09 12:39:40 +02:00
committed by Laurențiu Nicola
parent 9d473a0b9f
commit 55371be807
9 changed files with 136 additions and 618 deletions

View File

@@ -412,13 +412,16 @@ pub(crate) fn signature_help(
pub(crate) fn inlay_hint(line_index: &LineIndex, inlay_hint: InlayHint) -> lsp_ext::InlayHint {
lsp_ext::InlayHint {
label: inlay_hint.label.to_string(),
text: inlay_hint.label.to_string(),
range: range(line_index, inlay_hint.range),
kind: match inlay_hint.kind {
InlayKind::ParameterHint => lsp_ext::InlayKind::ParameterHint,
InlayKind::TypeHint => lsp_ext::InlayKind::TypeHint,
InlayKind::ChainingHint => lsp_ext::InlayKind::ChainingHint,
},
kind: Some(match inlay_hint.kind {
InlayKind::ParameterHint => lsp_ext::InlayKind::Parameter,
InlayKind::TypeHint => lsp_ext::InlayKind::Type,
InlayKind::ChainingHint => lsp_ext::InlayKind::Other,
}),
description: Some("test description".to_string()),
whitespace_before: Some(true),
whitespace_after: Some(true),
}
}