Skip to content

Commit c4026bf

Browse files
committed
Auto merge of #14818 - poliorcetics:type-hints-after-item, r=Veykril
fix: place type inlay hints after the item and without left-padding **Before**: ![Type hints were placed before the item and there was left-padding that accentuaded the issue](https://github.com/rust-lang/rust-analyzer/assets/7951708/006a28e9-ed7b-4d49-a7e7-3c6da8efca79) **After**: ![Type hints are now placed after the item and without padding since there already is `: ` in front of the type](https://github.com/rust-lang/rust-analyzer/assets/7951708/330a847f-8c59-40c7-877f-bf1aaced30e2)
2 parents 72a1796 + 22599ad commit c4026bf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/ide/src/inlay_hints/bind_pat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ pub(super) fn hints(
106106
kind: InlayKind::Type,
107107
label,
108108
text_edit,
109-
position: InlayHintPosition::Before,
110-
pad_left: !has_colon,
109+
position: InlayHintPosition::After,
110+
pad_left: false,
111111
pad_right: false,
112112
});
113113

crates/ide/src/inlay_hints/chaining.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,8 @@ fn main() {
625625
[
626626
InlayHint {
627627
range: 124..130,
628-
position: Before,
629-
pad_left: true,
628+
position: After,
629+
pad_left: false,
630630
pad_right: false,
631631
kind: Type,
632632
label: [

0 commit comments

Comments
 (0)