Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/inlay_hints/bind_pat.rs')
-rw-r--r--crates/ide/src/inlay_hints/bind_pat.rs34
1 files changed, 7 insertions, 27 deletions
diff --git a/crates/ide/src/inlay_hints/bind_pat.rs b/crates/ide/src/inlay_hints/bind_pat.rs
index adec19c765..5227c651ff 100644
--- a/crates/ide/src/inlay_hints/bind_pat.rs
+++ b/crates/ide/src/inlay_hints/bind_pat.rs
@@ -12,9 +12,7 @@ use syntax::{
match_ast,
};
-use crate::{
- inlay_hints::closure_has_block_body, InlayHint, InlayHintsConfig, InlayKind, InlayTooltip,
-};
+use crate::{inlay_hints::closure_has_block_body, InlayHint, InlayHintsConfig, InlayKind};
use super::label_of_ty;
@@ -22,7 +20,7 @@ pub(super) fn hints(
acc: &mut Vec<InlayHint>,
famous_defs @ FamousDefs(sema, _): &FamousDefs<'_, '_>,
config: &InlayHintsConfig,
- file_id: FileId,
+ _file_id: FileId,
pat: &ast::IdentPat,
) -> Option<()> {
if !config.type_hints {
@@ -50,12 +48,8 @@ pub(super) fn hints(
Some(name) => name.syntax().text_range(),
None => pat.syntax().text_range(),
},
- kind: InlayKind::TypeHint,
+ kind: InlayKind::Type,
label,
- tooltip: pat
- .name()
- .map(|it| it.syntax().text_range())
- .map(|it| InlayTooltip::HoverRanged(file_id, it)),
});
Some(())
@@ -322,22 +316,14 @@ fn main(a: SliceIter<'_, Container>) {
[
InlayHint {
range: 484..554,
- kind: ChainingHint,
+ kind: Chaining,
label: [
"impl Iterator<Item = impl Iterator<Item = &&str>>",
],
- tooltip: Some(
- HoverRanged(
- FileId(
- 0,
- ),
- 484..554,
- ),
- ),
},
InlayHint {
range: 484..485,
- kind: ChainingHint,
+ kind: Chaining,
label: [
"",
InlayHintLabelPart {
@@ -350,6 +336,7 @@ fn main(a: SliceIter<'_, Container>) {
range: 289..298,
},
),
+ tooltip: "",
},
"<",
InlayHintLabelPart {
@@ -362,17 +349,10 @@ fn main(a: SliceIter<'_, Container>) {
range: 238..247,
},
),
+ tooltip: "",
},
">",
],
- tooltip: Some(
- HoverRanged(
- FileId(
- 0,
- ),
- 484..485,
- ),
- ),
},
]
"#]],