mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 01:17:27 +00:00
classify definition of a function right
This commit is contained in:
parent
79e6b3b0d1
commit
0dd08b8023
1 changed files with 3 additions and 0 deletions
|
@ -221,6 +221,9 @@ impl HasDefinition for AssocItem {
|
|||
}
|
||||
|
||||
fn from_def(db: &RootDatabase, file_id: HirFileId, def: Self::Def) -> Option<Definition> {
|
||||
if def.syntax().parent().and_then(ast::ItemList::cast).is_none() {
|
||||
return None;
|
||||
}
|
||||
let src = hir::Source { file_id, ast: def };
|
||||
let item = AssocItem::from_source(db, src)?;
|
||||
Some(item.definition(db))
|
||||
|
|
Loading…
Reference in a new issue