diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-28 16:43:11 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-28 16:43:11 +0100 |
commit | bb1d925dab36372c6bd1fb5671bb68ce938ff009 (patch) | |
tree | ad32fbab8caf6563961b1366c726d8323fb303f5 /crates/ide_db | |
parent | ce6bb5ccca48b177f6cd12b42b4c52f3e1b44e0c (diff) | |
parent | 772987911851d6480ec8c905c0cac1e2f881152c (diff) |
Merge #8212
8212: Basic support macro 2.0 r=jonas-schievink a=edwin0cheng
Turn out it is quite straight forward :)
r @jonas-schievink
![m2](https://user-images.githubusercontent.com/11014119/112712565-6eb99380-8f0b-11eb-88de-5d7f974dfe6d.png)
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ide_db')
-rw-r--r-- | crates/ide_db/src/defs.rs | 2 | ||||
-rw-r--r-- | crates/ide_db/src/symbol_index.rs | 3 |
2 files changed, 3 insertions, 2 deletions
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 { | |||
227 | let def: hir::TypeAlias = sema.to_def(&it)?; | 227 | let def: hir::TypeAlias = sema.to_def(&it)?; |
228 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) | 228 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) |
229 | }, | 229 | }, |
230 | ast::MacroRules(it) => { | 230 | ast::Macro(it) => { |
231 | let def = sema.to_def(&it)?; | 231 | let def = sema.to_def(&it)?; |
232 | Some(NameClass::Definition(Definition::Macro(def))) | 232 | Some(NameClass::Definition(Definition::Macro(def))) |
233 | }, | 233 | }, |
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)> { | |||
438 | ast::TypeAlias(it) => decl(it), | 438 | ast::TypeAlias(it) => decl(it), |
439 | ast::Const(it) => decl(it), | 439 | ast::Const(it) => decl(it), |
440 | ast::Static(it) => decl(it), | 440 | ast::Static(it) => decl(it), |
441 | ast::MacroRules(it) => decl(it), | 441 | ast::Macro(it) => decl(it), |
442 | ast::Union(it) => decl(it), | 442 | ast::Union(it) => decl(it), |
443 | _ => None, | 443 | _ => None, |
444 | } | 444 | } |
@@ -458,6 +458,7 @@ fn to_file_symbol(node: &SyntaxNode, file_id: FileId) -> Option<FileSymbol> { | |||
458 | CONST => FileSymbolKind::Const, | 458 | CONST => FileSymbolKind::Const, |
459 | STATIC => FileSymbolKind::Static, | 459 | STATIC => FileSymbolKind::Static, |
460 | MACRO_RULES => FileSymbolKind::Macro, | 460 | MACRO_RULES => FileSymbolKind::Macro, |
461 | MACRO_DEF => FileSymbolKind::Macro, | ||
461 | UNION => FileSymbolKind::Union, | 462 | UNION => FileSymbolKind::Union, |
462 | kind => unreachable!("{:?}", kind), | 463 | kind => unreachable!("{:?}", kind), |
463 | }, | 464 | }, |