3367: Fix highlighting of const patterns r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-02-28 15:56:07 +00:00 committed by GitHub
commit c692e07b4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 143 additions and 70 deletions

View file

@ -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,
}
@ -785,13 +785,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");