mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Fix name fetching being incorrect for asm operands
This commit is contained in:
parent
564926ac99
commit
c075a9980e
10 changed files with 107 additions and 93 deletions
|
@ -5259,13 +5259,10 @@ impl InlineAsmOperand {
|
|||
}
|
||||
|
||||
pub fn name(&self, db: &dyn HirDatabase) -> Option<Name> {
|
||||
db.body_with_source_map(self.owner)
|
||||
.1
|
||||
.template_map()?
|
||||
.1
|
||||
.get(&self.expr)?
|
||||
.get(self.index)
|
||||
.and_then(|(_, _, name)| name.clone())
|
||||
match &db.body(self.owner)[self.expr] {
|
||||
hir_def::hir::Expr::InlineAsm(e) => e.operands.get(self.index)?.0.clone(),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue