From 54c78c96dbe61c2f1b6ec9f83a35a8ad6f6ae4fe Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 19 Mar 2021 14:23:13 +0100 Subject: Rename derive-specific APIs --- crates/hir_expand/src/builtin_derive.rs | 2 +- crates/hir_expand/src/lib.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/hir_expand') diff --git a/crates/hir_expand/src/builtin_derive.rs b/crates/hir_expand/src/builtin_derive.rs index 60fd2ebdd..6ece4b289 100644 --- a/crates/hir_expand/src/builtin_derive.rs +++ b/crates/hir_expand/src/builtin_derive.rs @@ -317,7 +317,7 @@ $0 local_inner: false, }, krate: CrateId(0), - kind: MacroCallKind::Attr(attr_id, name.to_string()), + kind: MacroCallKind::Derive(attr_id, name.to_string()), }; let id: MacroCallId = db.intern_macro(loc).into(); diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs index 0a379651f..c958b0865 100644 --- a/crates/hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs @@ -271,21 +271,21 @@ pub struct MacroCallLoc { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum MacroCallKind { FnLike(AstId), - Attr(AstId, String), + Derive(AstId, 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 { 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()), } } } -- cgit v1.2.3