diff options
Diffstat (limited to 'crates/ra_ssr/src/lib.rs')
-rw-r--r-- | crates/ra_ssr/src/lib.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_ssr/src/lib.rs b/crates/ra_ssr/src/lib.rs index 5a71d4f31..2fb326b45 100644 --- a/crates/ra_ssr/src/lib.rs +++ b/crates/ra_ssr/src/lib.rs | |||
@@ -202,8 +202,12 @@ impl<'db> MatchFinder<'db> { | |||
202 | // For now we ignore rules that have a different kind than our node, otherwise | 202 | // For now we ignore rules that have a different kind than our node, otherwise |
203 | // we get lots of noise. If at some point we add support for restricting rules | 203 | // we get lots of noise. If at some point we add support for restricting rules |
204 | // to a particular kind of thing (e.g. only match type references), then we can | 204 | // to a particular kind of thing (e.g. only match type references), then we can |
205 | // relax this. | 205 | // relax this. We special-case expressions, since function calls can match |
206 | if rule.pattern.node.kind() != node.kind() { | 206 | // method calls. |
207 | if rule.pattern.node.kind() != node.kind() | ||
208 | && !(ast::Expr::can_cast(rule.pattern.node.kind()) | ||
209 | && ast::Expr::can_cast(node.kind())) | ||
210 | { | ||
207 | continue; | 211 | continue; |
208 | } | 212 | } |
209 | out.push(MatchDebugInfo { | 213 | out.push(MatchDebugInfo { |