Move imports locator to ide_db

This commit is contained in:
Aleksey Kladov 2020-02-06 16:26:43 +01:00
parent ec23030e16
commit dfbe96750b
4 changed files with 11 additions and 11 deletions

View File

@ -3,9 +3,9 @@
use either::Either; use either::Either;
use ra_assists::{AssistAction, AssistLabel}; use ra_assists::{AssistAction, AssistLabel};
use ra_db::{FilePosition, FileRange}; use ra_db::{FilePosition, FileRange};
use ra_ide_db::RootDatabase; use ra_ide_db::{imports_locator::ImportsLocatorIde, RootDatabase};
use crate::{imports_locator::ImportsLocatorIde, FileId, SourceChange, SourceFileEdit}; use crate::{FileId, SourceChange, SourceFileEdit};
pub use ra_assists::AssistId; pub use ra_assists::AssistId;

View File

@ -26,7 +26,6 @@ mod syntax_highlighting;
mod parent_module; mod parent_module;
mod references; mod references;
mod impls; mod impls;
mod imports_locator;
mod assists; mod assists;
mod diagnostics; mod diagnostics;
mod syntax_tree; mod syntax_tree;

View File

@ -3,22 +3,22 @@
use hir::{db::HirDatabase, ModuleDef, SourceBinder}; use hir::{db::HirDatabase, ModuleDef, SourceBinder};
use ra_assists::ImportsLocator; use ra_assists::ImportsLocator;
use ra_ide_db::{
defs::NameKind,
symbol_index::{self, FileSymbol},
RootDatabase,
};
use ra_prof::profile; use ra_prof::profile;
use ra_syntax::{ast, AstNode, SyntaxKind::NAME}; use ra_syntax::{ast, AstNode, SyntaxKind::NAME};
use crate::{references::classify_name, Query}; use crate::{
defs::classify_name,
defs::NameKind,
symbol_index::{self, FileSymbol, Query},
RootDatabase,
};
pub(crate) struct ImportsLocatorIde<'a> { pub struct ImportsLocatorIde<'a> {
source_binder: SourceBinder<'a, RootDatabase>, source_binder: SourceBinder<'a, RootDatabase>,
} }
impl<'a> ImportsLocatorIde<'a> { impl<'a> ImportsLocatorIde<'a> {
pub(crate) fn new(db: &'a RootDatabase) -> Self { pub fn new(db: &'a RootDatabase) -> Self {
Self { source_binder: SourceBinder::new(db) } Self { source_binder: SourceBinder::new(db) }
} }

View File

@ -8,6 +8,7 @@ pub mod feature_flags;
pub mod symbol_index; pub mod symbol_index;
pub mod change; pub mod change;
pub mod defs; pub mod defs;
pub mod imports_locator;
mod wasm_shims; mod wasm_shims;
use std::sync::Arc; use std::sync::Arc;