Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/ide/src/inlay_hints/bind_pat.rs39
1 files changed, 38 insertions, 1 deletions
diff --git a/crates/ide/src/inlay_hints/bind_pat.rs b/crates/ide/src/inlay_hints/bind_pat.rs
index 547004687c..79cc2bdf8f 100644
--- a/crates/ide/src/inlay_hints/bind_pat.rs
+++ b/crates/ide/src/inlay_hints/bind_pat.rs
@@ -183,7 +183,8 @@ mod tests {
use crate::{ClosureReturnTypeHints, fixture, inlay_hints::InlayHintsConfig};
use crate::inlay_hints::tests::{
- DISABLED_CONFIG, TEST_CONFIG, check, check_edit, check_no_edit, check_with_config,
+ DISABLED_CONFIG, TEST_CONFIG, check, check_edit, check_expect, check_no_edit,
+ check_with_config,
};
#[track_caller]
@@ -1255,4 +1256,40 @@ where
"#,
);
}
+
+ #[test]
+ fn generic_param_inlay_hint_has_location_link() {
+ check_expect(
+ InlayHintsConfig { type_hints: true, ..DISABLED_CONFIG },
+ r#"
+fn identity<T>(t: T) -> T {
+ let x = t;
+ x
+}
+"#,
+ expect![[r#"
+ [
+ (
+ 36..37,
+ [
+ InlayHintLabelPart {
+ text: "T",
+ linked_location: Some(
+ Computed(
+ FileRangeWrapper {
+ file_id: FileId(
+ 0,
+ ),
+ range: 12..13,
+ },
+ ),
+ ),
+ tooltip: "",
+ },
+ ],
+ ),
+ ]
+ "#]],
+ );
+ }
}