From 4a6ee4517aafce498e0a526f616716c2df08d78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Tue, 8 Mar 2022 12:01:02 +0200 Subject: [PATCH] Add back colons around inlay hints --- crates/rust-analyzer/src/to_proto.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index f25b2c8c69d..7809d24dd6c 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -415,7 +415,11 @@ 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(), + label: match inlay_hint.kind { + InlayKind::ParameterHint => format!("{}:", inlay_hint.label), + InlayKind::TypeHint => format!(": {}", inlay_hint.label), + InlayKind::ChainingHint => inlay_hint.label.to_string(), + }, position: match inlay_hint.kind { InlayKind::ParameterHint => position(line_index, inlay_hint.range.start()), InlayKind::TypeHint | InlayKind::ChainingHint => { @@ -429,7 +433,7 @@ pub(crate) fn inlay_hint(line_index: &LineIndex, inlay_hint: InlayHint) -> lsp_e }, tooltip: None, padding_left: Some(match inlay_hint.kind { - InlayKind::TypeHint => true, + InlayKind::TypeHint => false, InlayKind::ParameterHint => false, InlayKind::ChainingHint => true, }),