diff options
-rw-r--r-- | crates/ra_ide/src/ssr.rs | 4 | ||||
-rw-r--r-- | crates/ra_ssr/src/resolving.rs | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_ide/src/ssr.rs b/crates/ra_ide/src/ssr.rs index 63010677a..4348b43be 100644 --- a/crates/ra_ide/src/ssr.rs +++ b/crates/ra_ide/src/ssr.rs | |||
@@ -59,11 +59,11 @@ pub fn parse_search_replace( | |||
59 | rule: &str, | 59 | rule: &str, |
60 | parse_only: bool, | 60 | parse_only: bool, |
61 | db: &RootDatabase, | 61 | db: &RootDatabase, |
62 | position: FilePosition, | 62 | resolve_context: FilePosition, |
63 | selections: Vec<FileRange>, | 63 | selections: Vec<FileRange>, |
64 | ) -> Result<Vec<SourceFileEdit>, SsrError> { | 64 | ) -> Result<Vec<SourceFileEdit>, SsrError> { |
65 | let rule: SsrRule = rule.parse()?; | 65 | let rule: SsrRule = rule.parse()?; |
66 | let mut match_finder = MatchFinder::in_context(db, position, selections); | 66 | let mut match_finder = MatchFinder::in_context(db, resolve_context, selections); |
67 | match_finder.add_rule(rule)?; | 67 | match_finder.add_rule(rule)?; |
68 | if parse_only { | 68 | if parse_only { |
69 | return Ok(Vec::new()); | 69 | return Ok(Vec::new()); |
diff --git a/crates/ra_ssr/src/resolving.rs b/crates/ra_ssr/src/resolving.rs index 123bd2bb2..78d456546 100644 --- a/crates/ra_ssr/src/resolving.rs +++ b/crates/ra_ssr/src/resolving.rs | |||
@@ -141,14 +141,14 @@ impl Resolver<'_, '_> { | |||
141 | impl<'db> ResolutionScope<'db> { | 141 | impl<'db> ResolutionScope<'db> { |
142 | pub(crate) fn new( | 142 | pub(crate) fn new( |
143 | sema: &hir::Semantics<'db, ra_ide_db::RootDatabase>, | 143 | sema: &hir::Semantics<'db, ra_ide_db::RootDatabase>, |
144 | lookup_context: FilePosition, | 144 | resolve_context: FilePosition, |
145 | ) -> ResolutionScope<'db> { | 145 | ) -> ResolutionScope<'db> { |
146 | use ra_syntax::ast::AstNode; | 146 | use ra_syntax::ast::AstNode; |
147 | let file = sema.parse(lookup_context.file_id); | 147 | let file = sema.parse(resolve_context.file_id); |
148 | // Find a node at the requested position, falling back to the whole file. | 148 | // Find a node at the requested position, falling back to the whole file. |
149 | let node = file | 149 | let node = file |
150 | .syntax() | 150 | .syntax() |
151 | .token_at_offset(lookup_context.offset) | 151 | .token_at_offset(resolve_context.offset) |
152 | .left_biased() | 152 | .left_biased() |
153 | .map(|token| token.parent()) | 153 | .map(|token| token.parent()) |
154 | .unwrap_or_else(|| file.syntax().clone()); | 154 | .unwrap_or_else(|| file.syntax().clone()); |
@@ -156,7 +156,7 @@ impl<'db> ResolutionScope<'db> { | |||
156 | let scope = sema.scope(&node); | 156 | let scope = sema.scope(&node); |
157 | ResolutionScope { | 157 | ResolutionScope { |
158 | scope, | 158 | scope, |
159 | hygiene: hir::Hygiene::new(sema.db, lookup_context.file_id.into()), | 159 | hygiene: hir::Hygiene::new(sema.db, resolve_context.file_id.into()), |
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||