mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Classify name takes const patterns into account
This commit is contained in:
parent
9ef6359950
commit
209eb32796
6 changed files with 44 additions and 23 deletions
|
@ -156,7 +156,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
classify_name_ref(&sema, &name_ref).map(|d| (name_ref.syntax().clone(), d))
|
||||
},
|
||||
ast::Name(name) => {
|
||||
classify_name(&sema, &name).map(|d| (name.syntax().clone(), d))
|
||||
classify_name(&sema, &name).map(|d| (name.syntax().clone(), d.definition()))
|
||||
},
|
||||
_ => None,
|
||||
}
|
||||
|
@ -761,13 +761,13 @@ fn func(foo: i32) { if true { <|>foo; }; }
|
|||
fn test_hover_through_literal_string_in_builtin_macro() {
|
||||
check_hover_no_result(
|
||||
r#"
|
||||
//- /lib.rs
|
||||
//- /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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue