From c42bbc5e37dee8b1de309a6dd5b892651de4b676 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Thu, 27 Feb 2020 23:03:18 +0800 Subject: Ignore hover on builtin macro --- crates/ra_ide/src/hover.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'crates/ra_ide/src/hover.rs') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 177038e20..dfa0f1d97 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -174,6 +174,12 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Optionfoo; }; } ); } + #[test] + fn test_hover_through_literal_string_in_builtin_macro() { + check_hover_no_result( + r#" + //- /lib.rs + #[rustc_builtin_macro] + macro_rules! assert { + ($cond:expr) => {{ /* compiler built-in */ }}; + ($cond:expr,) => {{ /* compiler built-in */ }}; + ($cond:expr, $($arg:tt)+) => {{ /* compiler built-in */ }}; + } + + fn foo() { + assert!("hel<|>lo"); + } + "#, + ); + } + #[test] fn test_hover_non_ascii_space_doc() { check_hover_result( -- cgit v1.2.3