From 26f604b907f5c23404acec96b14e80064857cd17 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 22 Dec 2020 14:42:28 +0100 Subject: Store invocation site for eager macros --- crates/ide/src/goto_definition.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'crates/ide/src/goto_definition.rs') diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index 431da5d9c..47dd85ceb 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs @@ -749,6 +749,31 @@ fn test() { ); } + #[test] + fn goto_through_included_file() { + check( + r#" +//- /main.rs +#[rustc_builtin_macro] +macro_rules! include {} + + include!("foo.rs"); +//^^^^^^^^^^^^^^^^^^^ + +fn f() { + foo<|>(); +} + +mod confuse_index { + pub fn foo() {} +} + +//- /foo.rs +fn foo() {} + "#, + ); + } + #[test] fn goto_for_type_param() { check( -- cgit v1.2.3