diff options
Diffstat (limited to 'crates/ide/src/goto_definition.rs')
-rw-r--r-- | crates/ide/src/goto_definition.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index a2c97061f..8574d1e3f 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs | |||
@@ -21,6 +21,8 @@ use crate::{ | |||
21 | // | 21 | // |
22 | // | VS Code | kbd:[F12] | 22 | // | VS Code | kbd:[F12] |
23 | // |=== | 23 | // |=== |
24 | // | ||
25 | // image::https://user-images.githubusercontent.com/48062697/113065563-025fbe00-91b1-11eb-83e4-a5a703610b23.gif[] | ||
24 | pub(crate) fn goto_definition( | 26 | pub(crate) fn goto_definition( |
25 | db: &RootDatabase, | 27 | db: &RootDatabase, |
26 | position: FilePosition, | 28 | position: FilePosition, |
@@ -918,6 +920,21 @@ fn f() -> impl Iterator<Item$0 = u8> {} | |||
918 | } | 920 | } |
919 | 921 | ||
920 | #[test] | 922 | #[test] |
923 | #[should_panic = "unresolved reference"] | ||
924 | fn unknown_assoc_ty() { | ||
925 | check( | ||
926 | r#" | ||
927 | trait Iterator { | ||
928 | type Item; | ||
929 | //^^^^ | ||
930 | } | ||
931 | |||
932 | fn f() -> impl Iterator<Invalid$0 = u8> {} | ||
933 | "#, | ||
934 | ) | ||
935 | } | ||
936 | |||
937 | #[test] | ||
921 | fn goto_def_for_assoc_ty_in_path_multiple() { | 938 | fn goto_def_for_assoc_ty_in_path_multiple() { |
922 | check( | 939 | check( |
923 | r#" | 940 | r#" |