diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-29 10:23:33 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-29 10:23:33 +0100 |
commit | 9a9ddcc29793e5ba3bfece096e222736e2172555 (patch) | |
tree | 929b74f0646996d84351dfbc1974ed762eaa847b /crates/ra_ssr/src/matching.rs | |
parent | 04d2b7b256657f8e6816f8ed67aa5608bfe9e261 (diff) | |
parent | fcb6b166fbc506950dc2689adfa4d0b728d1a745 (diff) |
Merge #5564
5564: SSR: Restrict to current selection if any r=davidlattimore a=davidlattimore
The selection is also used to avoid unnecessary work, but only to the file level. Further restricting unnecessary work is left for later.
Co-authored-by: David Lattimore <[email protected]>
Diffstat (limited to 'crates/ra_ssr/src/matching.rs')
-rw-r--r-- | crates/ra_ssr/src/matching.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ssr/src/matching.rs b/crates/ra_ssr/src/matching.rs index 4862622bd..c1b66748e 100644 --- a/crates/ra_ssr/src/matching.rs +++ b/crates/ra_ssr/src/matching.rs | |||
@@ -706,8 +706,8 @@ mod tests { | |||
706 | let rule: SsrRule = "foo($x) ==>> bar($x)".parse().unwrap(); | 706 | let rule: SsrRule = "foo($x) ==>> bar($x)".parse().unwrap(); |
707 | let input = "fn foo() {} fn bar() {} fn main() { foo(1+2); }"; | 707 | let input = "fn foo() {} fn bar() {} fn main() { foo(1+2); }"; |
708 | 708 | ||
709 | let (db, position) = crate::tests::single_file(input); | 709 | let (db, position, selections) = crate::tests::single_file(input); |
710 | let mut match_finder = MatchFinder::in_context(&db, position); | 710 | let mut match_finder = MatchFinder::in_context(&db, position, selections); |
711 | match_finder.add_rule(rule).unwrap(); | 711 | match_finder.add_rule(rule).unwrap(); |
712 | let matches = match_finder.matches(); | 712 | let matches = match_finder.matches(); |
713 | assert_eq!(matches.matches.len(), 1); | 713 | assert_eq!(matches.matches.len(), 1); |