From 4520002b63b5a27e7676822aecfb2d435bf36e5a Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 27 Mar 2021 13:48:15 +0800 Subject: Unleash macro 2.0 in hightlight and more --- crates/ide_db/src/defs.rs | 2 +- crates/ide_db/src/symbol_index.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ide_db') diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index ab23dd7ac..0d9808d24 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs @@ -227,7 +227,7 @@ impl NameClass { let def: hir::TypeAlias = sema.to_def(&it)?; Some(NameClass::Definition(Definition::ModuleDef(def.into()))) }, - ast::MacroRules(it) => { + ast::Macro(it) => { let def = sema.to_def(&it)?; Some(NameClass::Definition(Definition::Macro(def))) }, diff --git a/crates/ide_db/src/symbol_index.rs b/crates/ide_db/src/symbol_index.rs index 35e382b5c..da427d686 100644 --- a/crates/ide_db/src/symbol_index.rs +++ b/crates/ide_db/src/symbol_index.rs @@ -438,7 +438,7 @@ fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr, TextRange)> { ast::TypeAlias(it) => decl(it), ast::Const(it) => decl(it), ast::Static(it) => decl(it), - ast::MacroRules(it) => decl(it), + ast::Macro(it) => decl(it), ast::Union(it) => decl(it), _ => None, } @@ -458,6 +458,7 @@ fn to_file_symbol(node: &SyntaxNode, file_id: FileId) -> Option { CONST => FileSymbolKind::Const, STATIC => FileSymbolKind::Static, MACRO_RULES => FileSymbolKind::Macro, + MACRO_DEF => FileSymbolKind::Macro, UNION => FileSymbolKind::Union, kind => unreachable!("{:?}", kind), }, -- cgit v1.2.3