mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Lookup lang attribute on assoc item trait directly
This commit is contained in:
parent
94b369faa3
commit
4901ea3eef
4 changed files with 67 additions and 54 deletions
|
@ -400,6 +400,7 @@ mod tests {
|
|||
(relevance.exact_name_match, "name"),
|
||||
(relevance.is_local, "local"),
|
||||
(relevance.exact_postfix_snippet_match, "snippet"),
|
||||
(relevance.is_op_method, "op_method"),
|
||||
]
|
||||
.into_iter()
|
||||
.filter_map(|(cond, desc)| if cond { Some(desc) } else { None })
|
||||
|
@ -1352,6 +1353,23 @@ fn main() {
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn op_method_relevances() {
|
||||
check_relevance(
|
||||
r#"
|
||||
#[lang = "sub"]
|
||||
trait Sub {
|
||||
fn sub(self, other: Self) -> Self { self }
|
||||
}
|
||||
impl Sub for u32 {}
|
||||
fn foo(a: u32) { a.$0 }
|
||||
"#,
|
||||
expect![[r#"
|
||||
me sub(…) (as Sub) [op_method]
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn struct_field_method_ref() {
|
||||
check_kinds(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue