aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ssr/src/matching.rs
diff options
context:
space:
mode:
authorDavid Lattimore <[email protected]>2020-07-22 06:00:28 +0100
committerDavid Lattimore <[email protected]>2020-07-24 12:34:00 +0100
commit3975952601888d9f77e466c12e8e389748984b33 (patch)
treee599abf34b90be63e091ea78bfa58fe46cf1b81a /crates/ra_ssr/src/matching.rs
parent02fc3d50ee4d179cc5a443a790544c2a5e439cb0 (diff)
SSR: Pass current file position through to SSR code.
In a subsequent commit, it will be used for resolving paths.
Diffstat (limited to 'crates/ra_ssr/src/matching.rs')
-rw-r--r--crates/ra_ssr/src/matching.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ssr/src/matching.rs b/crates/ra_ssr/src/matching.rs
index 005569f6f..a43d57c34 100644
--- a/crates/ra_ssr/src/matching.rs
+++ b/crates/ra_ssr/src/matching.rs
@@ -576,8 +576,8 @@ mod tests {
576 let rule: SsrRule = "foo($x) ==>> bar($x)".parse().unwrap(); 576 let rule: SsrRule = "foo($x) ==>> bar($x)".parse().unwrap();
577 let input = "fn foo() {} fn bar() {} fn main() { foo(1+2); }"; 577 let input = "fn foo() {} fn bar() {} fn main() { foo(1+2); }";
578 578
579 let (db, _) = crate::tests::single_file(input); 579 let (db, position) = crate::tests::single_file(input);
580 let mut match_finder = MatchFinder::new(&db); 580 let mut match_finder = MatchFinder::in_context(&db, position);
581 match_finder.add_rule(rule); 581 match_finder.add_rule(rule);
582 let matches = match_finder.matches(); 582 let matches = match_finder.matches();
583 assert_eq!(matches.matches.len(), 1); 583 assert_eq!(matches.matches.len(), 1);