Rename derive-specific APIs
This commit is contained in:
@@ -271,21 +271,21 @@ pub struct MacroCallLoc {
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum MacroCallKind {
|
||||
FnLike(AstId<ast::MacroCall>),
|
||||
Attr(AstId<ast::Item>, String),
|
||||
Derive(AstId<ast::Item>, String),
|
||||
}
|
||||
|
||||
impl MacroCallKind {
|
||||
fn file_id(&self) -> HirFileId {
|
||||
match self {
|
||||
MacroCallKind::FnLike(ast_id) => ast_id.file_id,
|
||||
MacroCallKind::Attr(ast_id, _) => ast_id.file_id,
|
||||
MacroCallKind::Derive(ast_id, _) => ast_id.file_id,
|
||||
}
|
||||
}
|
||||
|
||||
fn node(&self, db: &dyn db::AstDatabase) -> InFile<SyntaxNode> {
|
||||
match self {
|
||||
MacroCallKind::FnLike(ast_id) => ast_id.with_value(ast_id.to_node(db).syntax().clone()),
|
||||
MacroCallKind::Attr(ast_id, _) => {
|
||||
MacroCallKind::Derive(ast_id, _) => {
|
||||
ast_id.with_value(ast_id.to_node(db).syntax().clone())
|
||||
}
|
||||
}
|
||||
@@ -296,7 +296,7 @@ impl MacroCallKind {
|
||||
MacroCallKind::FnLike(ast_id) => {
|
||||
Some(ast_id.to_node(db).token_tree()?.syntax().clone())
|
||||
}
|
||||
MacroCallKind::Attr(ast_id, _) => Some(ast_id.to_node(db).syntax().clone()),
|
||||
MacroCallKind::Derive(ast_id, _) => Some(ast_id.to_node(db).syntax().clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user