pub(crate) fn macro_crate(self, db: &impl AstDatabase) -> Option<Crate> {
        match self.0 {
            HirFileIdRepr::File(_) => None,
            HirFileIdRepr::Macro(macro_file) => {
                let loc = macro_file.macro_call_id.loc(db);
                Some(loc.def.krate)
            }
        }
    }
/// Get the crate which the macro lives in, if it is a macro file.
Get the crate which the macro lives in, if it is a macro file.
Get the crate which the macro lives in if it is a macro file .
pub(crate) fn macro_crate(self, db: &impl AstDatabase) -> Option<Crate> {
        match self.0 {
            HirFileIdRepr::File(_) => None,
            HirFileIdRepr::Macro(macro_file) => {
                let loc = macro_file.macro_call_id.loc(db);
                Some(loc.def.krate)
            }
        }
    }
pub ( crate ) fn macro_crate ( self , db : & impl AstDatabase ) -> Option < Crate > { match self . 0 { HirFileIdRepr :: File ( _ ) => None , HirFileIdRepr :: Macro ( macro_file ) => { let loc = macro_file . macro_call_id . loc ( db ) ; Some ( loc . def . krate ) } } }
Get the crate which the macro lives in, if it is a macro file.
Get the crate which the macro lives in if it is a macro file .
self
db
&impl AstDatabase
self
db
&impl AstDatabase