one macro def should be enough

This commit is contained in:
Aleksey Kladov 2019-06-08 14:48:56 +03:00
parent 2c28f5245d
commit 1b783e33e9
6 changed files with 25 additions and 33 deletions

View file

@ -939,6 +939,15 @@ pub struct MacroDef {
pub(crate) id: MacroDefId,
}
impl MacroDef {
pub fn source(
&self,
db: &(impl DefDatabase + AstDatabase),
) -> (HirFileId, TreeArc<ast::MacroCall>) {
(self.id.0.file_id(), self.id.0.to_node(db))
}
}
pub enum Container {
Trait(Trait),
ImplBlock(ImplBlock),