diff options
-rw-r--r-- | crates/ra_ide/src/ssr.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/crates/ra_ide/src/ssr.rs b/crates/ra_ide/src/ssr.rs index 74fb6bab6..c011a2e74 100644 --- a/crates/ra_ide/src/ssr.rs +++ b/crates/ra_ide/src/ssr.rs | |||
@@ -223,15 +223,17 @@ fn find(pattern: &SsrPattern, code: &SyntaxNode) -> SsrMatches { | |||
223 | } | 223 | } |
224 | let kind = pattern.pattern.kind(); | 224 | let kind = pattern.pattern.kind(); |
225 | let matches = code | 225 | let matches = code |
226 | .descendants_with_tokens() | 226 | .descendants() |
227 | .filter(|n| n.kind() == kind) | 227 | .filter(|n| n.kind() == kind) |
228 | .filter_map(|code| { | 228 | .filter_map(|code| { |
229 | let match_ = Match { | 229 | let match_ = |
230 | place: code.as_node().unwrap().clone(), | 230 | Match { place: code.clone(), binding: HashMap::new(), ignored_comments: vec![] }; |
231 | binding: HashMap::new(), | 231 | check( |
232 | ignored_comments: vec![], | 232 | &SyntaxElement::from(pattern.pattern.clone()), |
233 | }; | 233 | &SyntaxElement::from(code), |
234 | check(&SyntaxElement::from(pattern.pattern.clone()), &code, &pattern.vars, match_) | 234 | &pattern.vars, |
235 | match_, | ||
236 | ) | ||
235 | }) | 237 | }) |
236 | .collect(); | 238 | .collect(); |
237 | SsrMatches { matches } | 239 | SsrMatches { matches } |