mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Re-export base_db from ide_db
This commit is contained in:
parent
2c787676c9
commit
19cce08662
52 changed files with 69 additions and 74 deletions
|
@ -73,8 +73,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 ide_db::base_db::{FileId, FilePosition, FileRange};
|
||||
use ide_db::source_change::SourceFileEdit;
|
||||
use resolving::ResolvedRule;
|
||||
use rustc_hash::FxHashMap;
|
||||
|
@ -126,7 +126,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 ide_db::RootDatabase) -> Result<MatchFinder<'db>, SsrError> {
|
||||
use base_db::SourceDatabaseExt;
|
||||
use ide_db::base_db::SourceDatabaseExt;
|
||||
use ide_db::symbol_index::SymbolsDatabase;
|
||||
if let Some(first_file_id) = db
|
||||
.local_roots()
|
||||
|
@ -160,7 +160,7 @@ impl<'db> MatchFinder<'db> {
|
|||
|
||||
/// Finds matches for all added rules and returns edits for all found matches.
|
||||
pub fn edits(&self) -> Vec<SourceFileEdit> {
|
||||
use base_db::SourceDatabaseExt;
|
||||
use ide_db::base_db::SourceDatabaseExt;
|
||||
let mut matches_by_file = FxHashMap::default();
|
||||
for m in self.matches().matches {
|
||||
matches_by_file
|
||||
|
@ -205,7 +205,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<MatchDebugInfo> {
|
||||
use base_db::SourceDatabaseExt;
|
||||
use ide_db::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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue