diff options
author | Aleksey Kladov <[email protected]> | 2019-03-13 13:04:28 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-03-17 09:46:13 +0000 |
commit | 182c05a96c25321ac3ff262cea098e0c4d7ed6f8 (patch) | |
tree | 151c81b7b5f55dda12a555c69993a86a61b84243 /crates/ra_syntax/src/ast.rs | |
parent | 0d8d9186563637f493ac7691268319373251b18a (diff) |
add name resolution from the old impl
unlike the old impl, this also handles macro imports across crates
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 81c709bfb..d8c2cb063 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -114,6 +114,9 @@ pub trait AttrsOwner: AstNode { | |||
114 | fn attrs(&self) -> AstChildren<Attr> { | 114 | fn attrs(&self) -> AstChildren<Attr> { |
115 | children(self) | 115 | children(self) |
116 | } | 116 | } |
117 | fn has_atom_attr(&self, atom: &str) -> bool { | ||
118 | self.attrs().filter_map(|x| x.as_atom()).any(|x| x == atom) | ||
119 | } | ||
117 | } | 120 | } |
118 | 121 | ||
119 | pub trait DocCommentsOwner: AstNode { | 122 | pub trait DocCommentsOwner: AstNode { |
@@ -153,12 +156,6 @@ pub trait DocCommentsOwner: AstNode { | |||
153 | } | 156 | } |
154 | } | 157 | } |
155 | 158 | ||
156 | impl FnDef { | ||
157 | pub fn has_atom_attr(&self, atom: &str) -> bool { | ||
158 | self.attrs().filter_map(|x| x.as_atom()).any(|x| x == atom) | ||
159 | } | ||
160 | } | ||
161 | |||
162 | impl Attr { | 159 | impl Attr { |
163 | pub fn is_inner(&self) -> bool { | 160 | pub fn is_inner(&self) -> bool { |
164 | let tt = match self.value() { | 161 | let tt = match self.value() { |