diff options
Diffstat (limited to 'crates/ra_ssr/src/lib.rs')
-rw-r--r-- | crates/ra_ssr/src/lib.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_ssr/src/lib.rs b/crates/ra_ssr/src/lib.rs index 7b6409806..6d578610b 100644 --- a/crates/ra_ssr/src/lib.rs +++ b/crates/ra_ssr/src/lib.rs | |||
@@ -4,6 +4,7 @@ | |||
4 | //! based on a template. | 4 | //! based on a template. |
5 | 5 | ||
6 | mod matching; | 6 | mod matching; |
7 | mod nester; | ||
7 | mod parsing; | 8 | mod parsing; |
8 | mod replacing; | 9 | mod replacing; |
9 | mod search; | 10 | mod search; |
@@ -90,8 +91,10 @@ impl<'db> MatchFinder<'db> { | |||
90 | /// Returns matches for all added rules. | 91 | /// Returns matches for all added rules. |
91 | pub fn matches(&self) -> SsrMatches { | 92 | pub fn matches(&self) -> SsrMatches { |
92 | let mut matches = Vec::new(); | 93 | let mut matches = Vec::new(); |
93 | self.find_all_matches(&mut matches); | 94 | for rule in &self.rules { |
94 | SsrMatches { matches } | 95 | self.find_matches_for_rule(rule, &mut matches); |
96 | } | ||
97 | nester::nest_and_remove_collisions(matches, &self.sema) | ||
95 | } | 98 | } |
96 | 99 | ||
97 | /// Finds all nodes in `file_id` whose text is exactly equal to `snippet` and attempts to match | 100 | /// Finds all nodes in `file_id` whose text is exactly equal to `snippet` and attempts to match |