mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Switch to the new location for impls
This commit is contained in:
parent
b0739d5a26
commit
7b0644d81e
16 changed files with 69 additions and 32 deletions
|
@ -107,8 +107,10 @@ impl FromSource for MacroDef {
|
|||
impl FromSource for ImplBlock {
|
||||
type Ast = ast::ImplBlock;
|
||||
fn from_source(db: &(impl DefDatabase + AstDatabase), src: InFile<Self::Ast>) -> Option<Self> {
|
||||
let id = from_source(db, src)?;
|
||||
Some(ImplBlock { id })
|
||||
// XXX: use `.parent()` to avoid finding ourselves
|
||||
let parent = src.value.syntax().parent()?;
|
||||
let container = Container::find(db, src.with_value(parent).as_ref())?;
|
||||
container.child_by_source(db)[keys::IMPL].get(&src).copied().map(ImplBlock::from)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue