aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ssr/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-08-13 15:31:49 +0100
committerGitHub <[email protected]>2020-08-13 15:31:49 +0100
commite9926948ca267932ccc1341388bfd1b3fa88a001 (patch)
treecc4b797cb39a40b59e9e3d37178e8a1907f12358 /crates/ra_ssr/src
parent902f74c2697cc2a50de9067845814a2a852fccfd (diff)
parent50f8c1ebf23f634b68529603a917e3feeda457fa (diff)
Merge #5747
5747: Rename crate r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ssr/src')
-rw-r--r--crates/ra_ssr/src/lib.rs8
-rw-r--r--crates/ra_ssr/src/matching.rs2
-rw-r--r--crates/ra_ssr/src/resolving.rs2
-rw-r--r--crates/ra_ssr/src/search.rs4
-rw-r--r--crates/ra_ssr/src/tests.rs6
5 files changed, 11 insertions, 11 deletions
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;
18pub use crate::errors::SsrError; 18pub use crate::errors::SsrError;
19pub use crate::matching::Match; 19pub use crate::matching::Match;
20use crate::matching::MatchFailureReason; 20use crate::matching::MatchFailureReason;
21use base_db::{FileId, FilePosition, FileRange};
21use hir::Semantics; 22use hir::Semantics;
22use ra_db::{FileId, FilePosition, FileRange};
23use ra_ide_db::source_change::SourceFileEdit; 23use ra_ide_db::source_change::SourceFileEdit;
24use resolving::ResolvedRule; 24use resolving::ResolvedRule;
25use rustc_hash::FxHashMap; 25use rustc_hash::FxHashMap;
@@ -71,7 +71,7 @@ impl<'db> MatchFinder<'db> {
71 71
72 /// Constructs an instance using the start of the first file in `db` as the lookup context. 72 /// Constructs an instance using the start of the first file in `db` as the lookup context.
73 pub fn at_first_file(db: &'db ra_ide_db::RootDatabase) -> Result<MatchFinder<'db>, SsrError> { 73 pub fn at_first_file(db: &'db ra_ide_db::RootDatabase) -> Result<MatchFinder<'db>, SsrError> {
74 use ra_db::SourceDatabaseExt; 74 use base_db::SourceDatabaseExt;
75 use ra_ide_db::symbol_index::SymbolsDatabase; 75 use ra_ide_db::symbol_index::SymbolsDatabase;
76 if let Some(first_file_id) = db 76 if let Some(first_file_id) = db
77 .local_roots() 77 .local_roots()
@@ -105,7 +105,7 @@ impl<'db> MatchFinder<'db> {
105 105
106 /// Finds matches for all added rules and returns edits for all found matches. 106 /// Finds matches for all added rules and returns edits for all found matches.
107 pub fn edits(&self) -> Vec<SourceFileEdit> { 107 pub fn edits(&self) -> Vec<SourceFileEdit> {
108 use ra_db::SourceDatabaseExt; 108 use base_db::SourceDatabaseExt;
109 let mut matches_by_file = FxHashMap::default(); 109 let mut matches_by_file = FxHashMap::default();
110 for m in self.matches().matches { 110 for m in self.matches().matches {
111 matches_by_file 111 matches_by_file
@@ -150,7 +150,7 @@ impl<'db> MatchFinder<'db> {
150 /// them, while recording reasons why they don't match. This API is useful for command 150 /// them, while recording reasons why they don't match. This API is useful for command
151 /// line-based debugging where providing a range is difficult. 151 /// line-based debugging where providing a range is difficult.
152 pub fn debug_where_text_equal(&self, file_id: FileId, snippet: &str) -> Vec<MatchDebugInfo> { 152 pub fn debug_where_text_equal(&self, file_id: FileId, snippet: &str) -> Vec<MatchDebugInfo> {
153 use ra_db::SourceDatabaseExt; 153 use base_db::SourceDatabaseExt;
154 let file = self.sema.parse(file_id); 154 let file = self.sema.parse(file_id);
155 let mut res = Vec::new(); 155 let mut res = Vec::new();
156 let file_text = self.sema.db.file_text(file_id); 156 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::{
6 resolving::{ResolvedPattern, ResolvedRule, UfcsCallInfo}, 6 resolving::{ResolvedPattern, ResolvedRule, UfcsCallInfo},
7 SsrMatches, 7 SsrMatches,
8}; 8};
9use base_db::FileRange;
9use hir::Semantics; 10use hir::Semantics;
10use ra_db::FileRange;
11use rustc_hash::FxHashMap; 11use rustc_hash::FxHashMap;
12use std::{cell::Cell, iter::Peekable}; 12use std::{cell::Cell, iter::Peekable};
13use syntax::ast::{AstNode, AstToken}; 13use 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 @@
2 2
3use crate::errors::error; 3use crate::errors::error;
4use crate::{parsing, SsrError}; 4use crate::{parsing, SsrError};
5use base_db::FilePosition;
5use parsing::Placeholder; 6use parsing::Placeholder;
6use ra_db::FilePosition;
7use rustc_hash::FxHashMap; 7use rustc_hash::FxHashMap;
8use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken}; 8use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken};
9use test_utils::mark; 9use 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::{
5 resolving::{ResolvedPath, ResolvedPattern, ResolvedRule}, 5 resolving::{ResolvedPath, ResolvedPattern, ResolvedRule},
6 Match, MatchFinder, 6 Match, MatchFinder,
7}; 7};
8use ra_db::{FileId, FileRange}; 8use base_db::{FileId, FileRange};
9use ra_ide_db::{ 9use ra_ide_db::{
10 defs::Definition, 10 defs::Definition,
11 search::{Reference, SearchScope}, 11 search::{Reference, SearchScope},
@@ -145,7 +145,7 @@ impl<'db> MatchFinder<'db> {
145 fn search_files_do(&self, mut callback: impl FnMut(FileId)) { 145 fn search_files_do(&self, mut callback: impl FnMut(FileId)) {
146 if self.restrict_ranges.is_empty() { 146 if self.restrict_ranges.is_empty() {
147 // Unrestricted search. 147 // Unrestricted search.
148 use ra_db::SourceDatabaseExt; 148 use base_db::SourceDatabaseExt;
149 use ra_ide_db::symbol_index::SymbolsDatabase; 149 use ra_ide_db::symbol_index::SymbolsDatabase;
150 for &root in self.sema.db.local_roots().iter() { 150 for &root in self.sema.db.local_roots().iter() {
151 let sr = self.sema.db.source_root(root); 151 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 @@
1use crate::{MatchFinder, SsrRule}; 1use crate::{MatchFinder, SsrRule};
2use base_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt};
2use expect::{expect, Expect}; 3use expect::{expect, Expect};
3use ra_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt};
4use rustc_hash::FxHashSet; 4use rustc_hash::FxHashSet;
5use std::sync::Arc; 5use std::sync::Arc;
6use test_utils::{mark, RangeOrOffset}; 6use test_utils::{mark, RangeOrOffset};
@@ -62,7 +62,7 @@ fn parser_undefined_placeholder_in_replacement() {
62/// `code` may optionally contain a cursor marker `<|>`. If it doesn't, then the position will be 62/// `code` may optionally contain a cursor marker `<|>`. If it doesn't, then the position will be
63/// the start of the file. If there's a second cursor marker, then we'll return a single range. 63/// the start of the file. If there's a second cursor marker, then we'll return a single range.
64pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec<FileRange>) { 64pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec<FileRange>) {
65 use ra_db::fixture::WithFixture; 65 use base_db::fixture::WithFixture;
66 use ra_ide_db::symbol_index::SymbolsDatabase; 66 use ra_ide_db::symbol_index::SymbolsDatabase;
67 let (mut db, file_id, range_or_offset) = if code.contains(test_utils::CURSOR_MARKER) { 67 let (mut db, file_id, range_or_offset) = if code.contains(test_utils::CURSOR_MARKER) {
68 ra_ide_db::RootDatabase::with_range_or_offset(code) 68 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,
83 } 83 }
84 } 84 }
85 let mut local_roots = FxHashSet::default(); 85 let mut local_roots = FxHashSet::default();
86 local_roots.insert(ra_db::fixture::WORKSPACE); 86 local_roots.insert(base_db::fixture::WORKSPACE);
87 db.set_local_roots_with_durability(Arc::new(local_roots), Durability::HIGH); 87 db.set_local_roots_with_durability(Arc::new(local_roots), Durability::HIGH);
88 (db, position, selections) 88 (db, position, selections)
89} 89}