From ed20a857f485a471369cd99b843af19a4d875ad0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 16:25:38 +0200 Subject: Rename ra_db -> base_db --- crates/ra_ssr/src/lib.rs | 8 ++++---- crates/ra_ssr/src/matching.rs | 2 +- crates/ra_ssr/src/resolving.rs | 2 +- crates/ra_ssr/src/search.rs | 4 ++-- crates/ra_ssr/src/tests.rs | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'crates/ra_ssr/src') diff --git a/crates/ra_ssr/src/lib.rs b/crates/ra_ssr/src/lib.rs index fb53212a3..6725582e4 100644 --- a/crates/ra_ssr/src/lib.rs +++ b/crates/ra_ssr/src/lib.rs @@ -18,8 +18,8 @@ use crate::errors::bail; pub use crate::errors::SsrError; pub use crate::matching::Match; use crate::matching::MatchFailureReason; +use base_db::{FileId, FilePosition, FileRange}; use hir::Semantics; -use ra_db::{FileId, FilePosition, FileRange}; use ra_ide_db::source_change::SourceFileEdit; use resolving::ResolvedRule; use rustc_hash::FxHashMap; @@ -71,7 +71,7 @@ impl<'db> MatchFinder<'db> { /// Constructs an instance using the start of the first file in `db` as the lookup context. pub fn at_first_file(db: &'db ra_ide_db::RootDatabase) -> Result, SsrError> { - use ra_db::SourceDatabaseExt; + use base_db::SourceDatabaseExt; use ra_ide_db::symbol_index::SymbolsDatabase; if let Some(first_file_id) = db .local_roots() @@ -105,7 +105,7 @@ impl<'db> MatchFinder<'db> { /// Finds matches for all added rules and returns edits for all found matches. pub fn edits(&self) -> Vec { - use ra_db::SourceDatabaseExt; + use base_db::SourceDatabaseExt; let mut matches_by_file = FxHashMap::default(); for m in self.matches().matches { matches_by_file @@ -150,7 +150,7 @@ impl<'db> MatchFinder<'db> { /// them, while recording reasons why they don't match. This API is useful for command /// line-based debugging where providing a range is difficult. pub fn debug_where_text_equal(&self, file_id: FileId, snippet: &str) -> Vec { - use ra_db::SourceDatabaseExt; + use base_db::SourceDatabaseExt; let file = self.sema.parse(file_id); let mut res = Vec::new(); let file_text = self.sema.db.file_text(file_id); diff --git a/crates/ra_ssr/src/matching.rs b/crates/ra_ssr/src/matching.rs index 6e0b92352..e81a87c47 100644 --- a/crates/ra_ssr/src/matching.rs +++ b/crates/ra_ssr/src/matching.rs @@ -6,8 +6,8 @@ use crate::{ resolving::{ResolvedPattern, ResolvedRule, UfcsCallInfo}, SsrMatches, }; +use base_db::FileRange; use hir::Semantics; -use ra_db::FileRange; use rustc_hash::FxHashMap; use std::{cell::Cell, iter::Peekable}; use syntax::ast::{AstNode, AstToken}; diff --git a/crates/ra_ssr/src/resolving.rs b/crates/ra_ssr/src/resolving.rs index bfc20705b..dac09bae8 100644 --- a/crates/ra_ssr/src/resolving.rs +++ b/crates/ra_ssr/src/resolving.rs @@ -2,8 +2,8 @@ use crate::errors::error; use crate::{parsing, SsrError}; +use base_db::FilePosition; use parsing::Placeholder; -use ra_db::FilePosition; use rustc_hash::FxHashMap; use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken}; use test_utils::mark; diff --git a/crates/ra_ssr/src/search.rs b/crates/ra_ssr/src/search.rs index e44e14959..434953fb4 100644 --- a/crates/ra_ssr/src/search.rs +++ b/crates/ra_ssr/src/search.rs @@ -5,7 +5,7 @@ use crate::{ resolving::{ResolvedPath, ResolvedPattern, ResolvedRule}, Match, MatchFinder, }; -use ra_db::{FileId, FileRange}; +use base_db::{FileId, FileRange}; use ra_ide_db::{ defs::Definition, search::{Reference, SearchScope}, @@ -145,7 +145,7 @@ impl<'db> MatchFinder<'db> { fn search_files_do(&self, mut callback: impl FnMut(FileId)) { if self.restrict_ranges.is_empty() { // Unrestricted search. - use ra_db::SourceDatabaseExt; + use base_db::SourceDatabaseExt; use ra_ide_db::symbol_index::SymbolsDatabase; for &root in self.sema.db.local_roots().iter() { let sr = self.sema.db.source_root(root); diff --git a/crates/ra_ssr/src/tests.rs b/crates/ra_ssr/src/tests.rs index 4bc09c1e4..54c3da9db 100644 --- a/crates/ra_ssr/src/tests.rs +++ b/crates/ra_ssr/src/tests.rs @@ -1,6 +1,6 @@ use crate::{MatchFinder, SsrRule}; +use base_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt}; use expect::{expect, Expect}; -use ra_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt}; use rustc_hash::FxHashSet; use std::sync::Arc; use test_utils::{mark, RangeOrOffset}; @@ -62,7 +62,7 @@ fn parser_undefined_placeholder_in_replacement() { /// `code` may optionally contain a cursor marker `<|>`. If it doesn't, then the position will be /// the start of the file. If there's a second cursor marker, then we'll return a single range. pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec) { - use ra_db::fixture::WithFixture; + use base_db::fixture::WithFixture; use ra_ide_db::symbol_index::SymbolsDatabase; let (mut db, file_id, range_or_offset) = if code.contains(test_utils::CURSOR_MARKER) { ra_ide_db::RootDatabase::with_range_or_offset(code) @@ -83,7 +83,7 @@ pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, } } let mut local_roots = FxHashSet::default(); - local_roots.insert(ra_db::fixture::WORKSPACE); + local_roots.insert(base_db::fixture::WORKSPACE); db.set_local_roots_with_durability(Arc::new(local_roots), Durability::HIGH); (db, position, selections) } -- cgit v1.2.3