From fcb6b166fbc506950dc2689adfa4d0b728d1a745 Mon Sep 17 00:00:00 2001 From: David Lattimore Date: Wed, 29 Jul 2020 19:20:40 +1000 Subject: SSR: Rename position and lookup_context to resolve_context --- crates/ra_ide/src/ssr.rs | 4 ++-- 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( rule: &str, parse_only: bool, db: &RootDatabase, - position: FilePosition, + resolve_context: FilePosition, selections: Vec, ) -> Result, SsrError> { let rule: SsrRule = rule.parse()?; - let mut match_finder = MatchFinder::in_context(db, position, selections); + let mut match_finder = MatchFinder::in_context(db, resolve_context, selections); match_finder.add_rule(rule)?; if parse_only { 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<'_, '_> { impl<'db> ResolutionScope<'db> { pub(crate) fn new( sema: &hir::Semantics<'db, ra_ide_db::RootDatabase>, - lookup_context: FilePosition, + resolve_context: FilePosition, ) -> ResolutionScope<'db> { use ra_syntax::ast::AstNode; - let file = sema.parse(lookup_context.file_id); + let file = sema.parse(resolve_context.file_id); // Find a node at the requested position, falling back to the whole file. let node = file .syntax() - .token_at_offset(lookup_context.offset) + .token_at_offset(resolve_context.offset) .left_biased() .map(|token| token.parent()) .unwrap_or_else(|| file.syntax().clone()); @@ -156,7 +156,7 @@ impl<'db> ResolutionScope<'db> { let scope = sema.scope(&node); ResolutionScope { scope, - hygiene: hir::Hygiene::new(sema.db, lookup_context.file_id.into()), + hygiene: hir::Hygiene::new(sema.db, resolve_context.file_id.into()), } } -- cgit v1.2.3