mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Support more IDE features for asm operands
This commit is contained in:
parent
811905fce8
commit
95d8d8e697
13 changed files with 180 additions and 40 deletions
|
@ -5253,6 +5253,22 @@ pub struct InlineAsmOperand {
|
|||
index: usize,
|
||||
}
|
||||
|
||||
impl InlineAsmOperand {
|
||||
pub fn parent(self, _db: &dyn HirDatabase) -> DefWithBody {
|
||||
self.owner.into()
|
||||
}
|
||||
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Document this
|
||||
#[derive(Debug)]
|
||||
pub struct Callable {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue