mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
use Source for MacroDef
This commit is contained in:
parent
a6e339e822
commit
8b94b429e5
4 changed files with 18 additions and 13 deletions
|
@ -1003,12 +1003,17 @@ pub struct MacroDef {
|
|||
pub(crate) id: MacroDefId,
|
||||
}
|
||||
|
||||
impl HasSource for MacroDef {
|
||||
type Ast = TreeArc<ast::MacroCall>;
|
||||
|
||||
fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::MacroCall>> {
|
||||
(self.id.0.file_id(), self.id.0.to_node(db)).into()
|
||||
}
|
||||
}
|
||||
|
||||
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 fn source(&self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::MacroCall>> {
|
||||
(self.id.0.file_id(), self.id.0.to_node(db)).into()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue