diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-13 15:31:49 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-13 15:31:49 +0100 |
commit | e9926948ca267932ccc1341388bfd1b3fa88a001 (patch) | |
tree | cc4b797cb39a40b59e9e3d37178e8a1907f12358 /crates/ra_ssr | |
parent | 902f74c2697cc2a50de9067845814a2a852fccfd (diff) | |
parent | 50f8c1ebf23f634b68529603a917e3feeda457fa (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')
-rw-r--r-- | crates/ra_ssr/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_ssr/src/lib.rs | 8 | ||||
-rw-r--r-- | crates/ra_ssr/src/matching.rs | 2 | ||||
-rw-r--r-- | crates/ra_ssr/src/resolving.rs | 2 | ||||
-rw-r--r-- | crates/ra_ssr/src/search.rs | 4 | ||||
-rw-r--r-- | crates/ra_ssr/src/tests.rs | 6 |
6 files changed, 12 insertions, 12 deletions
diff --git a/crates/ra_ssr/Cargo.toml b/crates/ra_ssr/Cargo.toml index 958baa2df..f290939cf 100644 --- a/crates/ra_ssr/Cargo.toml +++ b/crates/ra_ssr/Cargo.toml | |||
@@ -13,7 +13,7 @@ doctest = false | |||
13 | [dependencies] | 13 | [dependencies] |
14 | text_edit = { path = "../text_edit" } | 14 | text_edit = { path = "../text_edit" } |
15 | syntax = { path = "../syntax" } | 15 | syntax = { path = "../syntax" } |
16 | ra_db = { path = "../ra_db" } | 16 | base_db = { path = "../base_db" } |
17 | ra_ide_db = { path = "../ra_ide_db" } | 17 | ra_ide_db = { path = "../ra_ide_db" } |
18 | hir = { path = "../ra_hir", package = "ra_hir" } | 18 | hir = { path = "../ra_hir", package = "ra_hir" } |
19 | rustc-hash = "1.1.0" | 19 | rustc-hash = "1.1.0" |
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; | |||
18 | pub use crate::errors::SsrError; | 18 | pub use crate::errors::SsrError; |
19 | pub use crate::matching::Match; | 19 | pub use crate::matching::Match; |
20 | use crate::matching::MatchFailureReason; | 20 | use crate::matching::MatchFailureReason; |
21 | use base_db::{FileId, FilePosition, FileRange}; | ||
21 | use hir::Semantics; | 22 | use hir::Semantics; |
22 | use ra_db::{FileId, FilePosition, FileRange}; | ||
23 | use ra_ide_db::source_change::SourceFileEdit; | 23 | use ra_ide_db::source_change::SourceFileEdit; |
24 | use resolving::ResolvedRule; | 24 | use resolving::ResolvedRule; |
25 | use rustc_hash::FxHashMap; | 25 | use 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 | }; |
9 | use base_db::FileRange; | ||
9 | use hir::Semantics; | 10 | use hir::Semantics; |
10 | use ra_db::FileRange; | ||
11 | use rustc_hash::FxHashMap; | 11 | use rustc_hash::FxHashMap; |
12 | use std::{cell::Cell, iter::Peekable}; | 12 | use std::{cell::Cell, iter::Peekable}; |
13 | use syntax::ast::{AstNode, AstToken}; | 13 | 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 @@ | |||
2 | 2 | ||
3 | use crate::errors::error; | 3 | use crate::errors::error; |
4 | use crate::{parsing, SsrError}; | 4 | use crate::{parsing, SsrError}; |
5 | use base_db::FilePosition; | ||
5 | use parsing::Placeholder; | 6 | use parsing::Placeholder; |
6 | use ra_db::FilePosition; | ||
7 | use rustc_hash::FxHashMap; | 7 | use rustc_hash::FxHashMap; |
8 | use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken}; | 8 | use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken}; |
9 | use test_utils::mark; | 9 | 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::{ | |||
5 | resolving::{ResolvedPath, ResolvedPattern, ResolvedRule}, | 5 | resolving::{ResolvedPath, ResolvedPattern, ResolvedRule}, |
6 | Match, MatchFinder, | 6 | Match, MatchFinder, |
7 | }; | 7 | }; |
8 | use ra_db::{FileId, FileRange}; | 8 | use base_db::{FileId, FileRange}; |
9 | use ra_ide_db::{ | 9 | use 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 @@ | |||
1 | use crate::{MatchFinder, SsrRule}; | 1 | use crate::{MatchFinder, SsrRule}; |
2 | use base_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt}; | ||
2 | use expect::{expect, Expect}; | 3 | use expect::{expect, Expect}; |
3 | use ra_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt}; | ||
4 | use rustc_hash::FxHashSet; | 4 | use rustc_hash::FxHashSet; |
5 | use std::sync::Arc; | 5 | use std::sync::Arc; |
6 | use test_utils::{mark, RangeOrOffset}; | 6 | use 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. |
64 | pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec<FileRange>) { | 64 | pub(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 | } |