aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-03-19 13:23:13 +0000
committerJonas Schievink <[email protected]>2021-03-19 13:23:13 +0000
commit54c78c96dbe61c2f1b6ec9f83a35a8ad6f6ae4fe (patch)
tree960d42c02317050c6415b13fc74ad3c1f55f1c20 /crates/hir_expand
parenta627377949d308603bb0bd7ef627ffe8186e1788 (diff)
Rename derive-specific APIs
Diffstat (limited to 'crates/hir_expand')
-rw-r--r--crates/hir_expand/src/builtin_derive.rs2
-rw-r--r--crates/hir_expand/src/lib.rs8
2 files changed, 5 insertions, 5 deletions
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
317 local_inner: false, 317 local_inner: false,
318 }, 318 },
319 krate: CrateId(0), 319 krate: CrateId(0),
320 kind: MacroCallKind::Attr(attr_id, name.to_string()), 320 kind: MacroCallKind::Derive(attr_id, name.to_string()),
321 }; 321 };
322 322
323 let id: MacroCallId = db.intern_macro(loc).into(); 323 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 {
271#[derive(Debug, Clone, PartialEq, Eq, Hash)] 271#[derive(Debug, Clone, PartialEq, Eq, Hash)]
272pub enum MacroCallKind { 272pub enum MacroCallKind {
273 FnLike(AstId<ast::MacroCall>), 273 FnLike(AstId<ast::MacroCall>),
274 Attr(AstId<ast::Item>, String), 274 Derive(AstId<ast::Item>, String),
275} 275}
276 276
277impl MacroCallKind { 277impl MacroCallKind {
278 fn file_id(&self) -> HirFileId { 278 fn file_id(&self) -> HirFileId {
279 match self { 279 match self {
280 MacroCallKind::FnLike(ast_id) => ast_id.file_id, 280 MacroCallKind::FnLike(ast_id) => ast_id.file_id,
281 MacroCallKind::Attr(ast_id, _) => ast_id.file_id, 281 MacroCallKind::Derive(ast_id, _) => ast_id.file_id,
282 } 282 }
283 } 283 }
284 284
285 fn node(&self, db: &dyn db::AstDatabase) -> InFile<SyntaxNode> { 285 fn node(&self, db: &dyn db::AstDatabase) -> InFile<SyntaxNode> {
286 match self { 286 match self {
287 MacroCallKind::FnLike(ast_id) => ast_id.with_value(ast_id.to_node(db).syntax().clone()), 287 MacroCallKind::FnLike(ast_id) => ast_id.with_value(ast_id.to_node(db).syntax().clone()),
288 MacroCallKind::Attr(ast_id, _) => { 288 MacroCallKind::Derive(ast_id, _) => {
289 ast_id.with_value(ast_id.to_node(db).syntax().clone()) 289 ast_id.with_value(ast_id.to_node(db).syntax().clone())
290 } 290 }
291 } 291 }
@@ -296,7 +296,7 @@ impl MacroCallKind {
296 MacroCallKind::FnLike(ast_id) => { 296 MacroCallKind::FnLike(ast_id) => {
297 Some(ast_id.to_node(db).token_tree()?.syntax().clone()) 297 Some(ast_id.to_node(db).token_tree()?.syntax().clone())
298 } 298 }
299 MacroCallKind::Attr(ast_id, _) => Some(ast_id.to_node(db).syntax().clone()), 299 MacroCallKind::Derive(ast_id, _) => Some(ast_id.to_node(db).syntax().clone()),
300 } 300 }
301 } 301 }
302} 302}