Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/goto_definition.rs')
| -rw-r--r-- | crates/ide/src/goto_definition.rs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index 93019527f4..cf0819a252 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs @@ -766,6 +766,13 @@ trait Foo$0 { } check( r#" +trait Foo$0 = ; + //^^^ +"#, + ); + + check( + r#" mod bar$0 { } //^^^ "#, @@ -1066,6 +1073,23 @@ fn f() -> impl Sub<Item$0 = u8> {} } #[test] + fn goto_def_for_module_declaration_in_path_if_types_and_values_same_name() { + check( + r#" +mod bar { + pub struct Foo {} + //^^^ + pub fn Foo() {} +} + +fn baz() { + let _foo_enum: bar::Foo$0 = bar::Foo {}; +} + "#, + ) + } + + #[test] fn unknown_assoc_ty() { check_unresolved( r#" @@ -1406,7 +1430,6 @@ include!("included.rs$0"); ); } - #[cfg(test)] mod goto_impl_of_trait_fn { use super::check; #[test] |