Unnamed repository; edit this file 'description' to name the repository.
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)
bors 2023-05-18
parent 72a1796 · parent 22599ad · commit c4026bf
-rw-r--r--crates/ide/src/inlay_hints/bind_pat.rs4
-rw-r--r--crates/ide/src/inlay_hints/chaining.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide/src/inlay_hints/bind_pat.rs b/crates/ide/src/inlay_hints/bind_pat.rs
index 3d5122a7cf..758338e6d6 100644
--- a/crates/ide/src/inlay_hints/bind_pat.rs
+++ b/crates/ide/src/inlay_hints/bind_pat.rs
@@ -106,8 +106,8 @@ pub(super) fn hints(
kind: InlayKind::Type,
label,
text_edit,
- position: InlayHintPosition::Before,
- pad_left: !has_colon,
+ position: InlayHintPosition::After,
+ pad_left: false,
pad_right: false,
});
diff --git a/crates/ide/src/inlay_hints/chaining.rs b/crates/ide/src/inlay_hints/chaining.rs
index cd1ac1e55e..5b7b027003 100644
--- a/crates/ide/src/inlay_hints/chaining.rs
+++ b/crates/ide/src/inlay_hints/chaining.rs
@@ -625,8 +625,8 @@ fn main() {
[
InlayHint {
range: 124..130,
- position: Before,
- pad_left: true,
+ position: After,
+ pad_left: false,
pad_right: false,
kind: Type,
label: [