@@ -418,16 +418,26 @@ pub(crate) fn inlay_hint(line_index: &LineIndex, inlay_hint: InlayHint) -> lsp_e
418
418
label : inlay_hint. label . to_string ( ) ,
419
419
position : match inlay_hint. kind {
420
420
InlayKind :: ParameterHint => position ( line_index, inlay_hint. range . start ( ) ) ,
421
- _ => position ( line_index, inlay_hint. range . end ( ) ) ,
421
+ InlayKind :: TypeHint | InlayKind :: ChainingHint => {
422
+ position ( line_index, inlay_hint. range . end ( ) )
423
+ }
422
424
} ,
423
425
kind : match inlay_hint. kind {
424
426
InlayKind :: ParameterHint => Some ( lsp_ext:: InlayHintKind :: PARAMETER ) ,
425
427
InlayKind :: TypeHint => Some ( lsp_ext:: InlayHintKind :: TYPE ) ,
426
428
InlayKind :: ChainingHint => None ,
427
429
} ,
428
430
tooltip : None ,
429
- padding_left : Some ( true ) ,
430
- padding_right : Some ( true ) ,
431
+ padding_left : Some ( match inlay_hint. kind {
432
+ InlayKind :: TypeHint => true ,
433
+ InlayKind :: ParameterHint => false ,
434
+ InlayKind :: ChainingHint => true ,
435
+ } ) ,
436
+ padding_right : Some ( match inlay_hint. kind {
437
+ InlayKind :: TypeHint => false ,
438
+ InlayKind :: ParameterHint => true ,
439
+ InlayKind :: ChainingHint => false ,
440
+ } ) ,
431
441
}
432
442
}
433
443
0 commit comments