Skip to content

Commit 4924072

Browse files
bors[bot]lnicola
andauthored
Merge #11658
11658: Add back colons around inlay hints r=Veykril a=lnicola Fixes #2797 (comment). I originally thought that other extensions don't include the colons, but the TypeScript one seems to do. Co-authored-by: Laurențiu Nicola <[email protected]>
2 parents 0f5df8e + 4a6ee45 commit 4924072

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

crates/rust-analyzer/src/to_proto.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,11 @@ pub(crate) fn signature_help(
415415

416416
pub(crate) fn inlay_hint(line_index: &LineIndex, inlay_hint: InlayHint) -> lsp_ext::InlayHint {
417417
lsp_ext::InlayHint {
418-
label: inlay_hint.label.to_string(),
418+
label: match inlay_hint.kind {
419+
InlayKind::ParameterHint => format!("{}:", inlay_hint.label),
420+
InlayKind::TypeHint => format!(": {}", inlay_hint.label),
421+
InlayKind::ChainingHint => inlay_hint.label.to_string(),
422+
},
419423
position: match inlay_hint.kind {
420424
InlayKind::ParameterHint => position(line_index, inlay_hint.range.start()),
421425
InlayKind::TypeHint | InlayKind::ChainingHint => {
@@ -429,7 +433,7 @@ pub(crate) fn inlay_hint(line_index: &LineIndex, inlay_hint: InlayHint) -> lsp_e
429433
},
430434
tooltip: None,
431435
padding_left: Some(match inlay_hint.kind {
432-
InlayKind::TypeHint => true,
436+
InlayKind::TypeHint => false,
433437
InlayKind::ParameterHint => false,
434438
InlayKind::ChainingHint => true,
435439
}),

0 commit comments

Comments
 (0)