aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/goto_definition.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs
index 76a741207..b1d567ca7 100644
--- a/crates/ra_ide/src/goto_definition.rs
+++ b/crates/ra_ide/src/goto_definition.rs
@@ -693,4 +693,31 @@ mod tests {
693 "foo FN_DEF FileId(1) [52; 63) [55; 58)", 693 "foo FN_DEF FileId(1) [52; 63) [55; 58)",
694 ); 694 );
695 } 695 }
696
697 #[test]
698 fn goto_through_format() {
699 check_goto(
700 "
701 //- /lib.rs
702 #[macro_export]
703 macro_rules! format {
704 ($($arg:tt)*) => ($crate::fmt::format($crate::__export::format_args!($($arg)*)))
705 }
706 #[rustc_builtin_macro]
707 #[macro_export]
708 macro_rules! format_args {
709 ($fmt:expr) => ({ /* compiler built-in */ });
710 ($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ })
711 }
712 pub mod __export {
713 pub use crate::format_args;
714 }
715 fn foo() -> i8 {}
716 fn test() {
717 format!(\"{}\", fo<|>o())
718 }
719 ",
720 "foo FN_DEF FileId(1) [359; 376) [362; 365)",
721 );
722 }
696} 723}