aboutsummaryrefslogtreecommitdiff
path: root/crates
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
parent15c5426b54412134d3c5f2992e58e852266fc22e (diff)
Remove hir usage from macro_rules! detection in structure_node()
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir/src/lib.rs3
-rw-r--r--crates/ra_ide/src/display/structure.rs6
2 files changed, 3 insertions, 6 deletions
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs
index 94da70cca..3d13978d4 100644
--- a/crates/ra_hir/src/lib.rs
+++ b/crates/ra_hir/src/lib.rs
@@ -58,7 +58,6 @@ pub use hir_def::{
58 type_ref::Mutability, 58 type_ref::Mutability,
59}; 59};
60pub use hir_expand::{ 60pub use hir_expand::{
61 name::name, name::AsName, name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, 61 name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin,
62 MacroFile, Origin,
63}; 62};
64pub use hir_ty::{display::HirDisplay, CallableDef}; 63pub use hir_ty::{display::HirDisplay, CallableDef};
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 }