Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Defines database & queries for macro expansion.

use base_db::{Crate, SourceDatabase};
use syntax::ast;

use crate::{AstId, declarative::DeclarativeMacroExpander};

#[query_group::query_group]
pub trait ExpandDatabase: SourceDatabase {
    /// Fetches (and compiles) the expander of this decl macro.
    #[salsa::invoke(DeclarativeMacroExpander::expander)]
    #[salsa::transparent]
    fn decl_macro_expander(
        &self,
        def_crate: Crate,
        id: AstId<ast::Macro>,
    ) -> &DeclarativeMacroExpander;
}