mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Hide MacroCallLoc
This commit is contained in:
parent
4d753fa6f5
commit
447268ceac
4 changed files with 19 additions and 13 deletions
|
@ -135,6 +135,16 @@ pub struct MacroDefId {
|
|||
pub kind: MacroDefKind,
|
||||
}
|
||||
|
||||
impl MacroDefId {
|
||||
pub fn as_call_id(
|
||||
self,
|
||||
db: &dyn db::AstDatabase,
|
||||
ast_id: AstId<ast::MacroCall>,
|
||||
) -> MacroCallId {
|
||||
db.intern_macro(MacroCallLoc { def: self, ast_id })
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum MacroDefKind {
|
||||
Declarative,
|
||||
|
@ -143,8 +153,8 @@ pub enum MacroDefKind {
|
|||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct MacroCallLoc {
|
||||
pub def: MacroDefId,
|
||||
pub ast_id: AstId<ast::MacroCall>,
|
||||
pub(crate) def: MacroDefId,
|
||||
pub(crate) ast_id: AstId<ast::MacroCall>,
|
||||
}
|
||||
|
||||
impl MacroCallId {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue