aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/display
diff options
context:
space:
mode:
authorRoland Ruckerbauer <[email protected]>2020-01-12 14:23:04 +0000
committerRoland Ruckerbauer <[email protected]>2020-01-12 16:34:57 +0000
commit20b8d283ae7d18faaa8aec86e029a573e755a1dd (patch)
tree621b44a5a65722c2563ee87a0b1f1fbd1245745a /crates/ra_ide/src/display
parent15c5426b54412134d3c5f2992e58e852266fc22e (diff)
Remove hir usage from macro_rules! detection in structure_node()
Diffstat (limited to 'crates/ra_ide/src/display')
-rw-r--r--crates/ra_ide/src/display/structure.rs6
1 files changed, 2 insertions, 4 deletions
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 @@
2 2
3use crate::TextRange; 3use crate::TextRange;
4 4
5use hir::{name, AsName, Path};
6use ra_syntax::{ 5use ra_syntax::{
7 ast::{self, AttrsOwner, NameOwner, TypeAscriptionOwner, TypeParamsOwner}, 6 ast::{self, AttrsOwner, NameOwner, TypeAscriptionOwner, TypeParamsOwner},
8 match_ast, AstNode, SourceFile, SyntaxKind, SyntaxNode, WalkEvent, 7 match_ast, AstNode, SourceFile, SyntaxKind, SyntaxNode, WalkEvent,
@@ -152,9 +151,8 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
152 Some(node) 151 Some(node)
153 }, 152 },
154 ast::MacroCall(it) => { 153 ast::MacroCall(it) => {
155 match it.path().and_then(|p| Path::from_ast(p)) { 154 match it.path().and_then(|it| it.segment()).and_then(|it| it.name_ref()) {
156 Some(path) if path.mod_path().segments.as_slice() == [name![macro_rules]] 155 Some(path_segment) if path_segment.text() == "macro_rules"
157 && it.name().map(|n| n.as_name()).is_some()
158 => decl(it), 156 => decl(it),
159 _ => None, 157 _ => None,
160 } 158 }