From 20b8d283ae7d18faaa8aec86e029a573e755a1dd Mon Sep 17 00:00:00 2001 From: Roland Ruckerbauer Date: Sun, 12 Jan 2020 15:23:04 +0100 Subject: Remove hir usage from macro_rules! detection in structure_node() --- crates/ra_ide/src/display/structure.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide/src/display') diff --git a/crates/ra_ide/src/display/structure.rs b/crates/ra_ide/src/display/structure.rs index fdd589648..944cc79df 100644 --- a/crates/ra_ide/src/display/structure.rs +++ b/crates/ra_ide/src/display/structure.rs @@ -2,7 +2,6 @@ use crate::TextRange; -use hir::{name, AsName, Path}; use ra_syntax::{ ast::{self, AttrsOwner, NameOwner, TypeAscriptionOwner, TypeParamsOwner}, match_ast, AstNode, SourceFile, SyntaxKind, SyntaxNode, WalkEvent, @@ -152,9 +151,8 @@ fn structure_node(node: &SyntaxNode) -> Option { Some(node) }, ast::MacroCall(it) => { - match it.path().and_then(|p| Path::from_ast(p)) { - Some(path) if path.mod_path().segments.as_slice() == [name![macro_rules]] - && it.name().map(|n| n.as_name()).is_some() + match it.path().and_then(|it| it.segment()).and_then(|it| it.name_ref()) { + Some(path_segment) if path_segment.text() == "macro_rules" => decl(it), _ => None, } -- cgit v1.2.3