Move symbol_index
This commit is contained in:
parent
ec95152a4e
commit
ad247aa670
@ -15,7 +15,7 @@
|
||||
|
||||
use crate::{
|
||||
db::{DebugData, RootDatabase},
|
||||
symbol_index::{SymbolIndex, SymbolsDatabase},
|
||||
ide_db::symbol_index::{SymbolIndex, SymbolsDatabase},
|
||||
};
|
||||
|
||||
#[derive(Default)]
|
||||
|
@ -12,6 +12,7 @@
|
||||
db::RootDatabase,
|
||||
display::{ShortLabel, ToNav},
|
||||
expand::descend_into_macros,
|
||||
ide_db::symbol_index,
|
||||
references::{classify_name_ref, NameKind::*},
|
||||
FilePosition, NavigationTarget, RangeInfo,
|
||||
};
|
||||
@ -94,7 +95,7 @@ pub(crate) fn reference_definition(
|
||||
};
|
||||
|
||||
// Fallback index based approach:
|
||||
let navs = crate::symbol_index::index_resolve(sb.db, name_ref.value)
|
||||
let navs = symbol_index::index_resolve(sb.db, name_ref.value)
|
||||
.into_iter()
|
||||
.map(|s| s.to_nav(sb.db))
|
||||
.collect();
|
||||
|
@ -3,6 +3,7 @@
|
||||
pub mod line_index;
|
||||
pub mod line_index_utils;
|
||||
pub mod feature_flags;
|
||||
pub mod symbol_index;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
@ -13,9 +14,8 @@
|
||||
};
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use crate::{
|
||||
ide_db::{feature_flags::FeatureFlags, line_index::LineIndex},
|
||||
symbol_index::{self, SymbolsDatabase},
|
||||
use crate::ide_db::{
|
||||
feature_flags::FeatureFlags, line_index::LineIndex, symbol_index::SymbolsDatabase,
|
||||
};
|
||||
|
||||
#[salsa::database(
|
||||
|
@ -29,7 +29,7 @@
|
||||
use fst::{self, Streamer};
|
||||
use ra_db::{
|
||||
salsa::{self, ParallelDatabase},
|
||||
SourceDatabaseExt, SourceRootId,
|
||||
FileId, SourceDatabaseExt, SourceRootId,
|
||||
};
|
||||
use ra_syntax::{
|
||||
ast::{self, NameOwner},
|
||||
@ -40,7 +40,7 @@
|
||||
#[cfg(not(feature = "wasm"))]
|
||||
use rayon::prelude::*;
|
||||
|
||||
use crate::{db::RootDatabase, FileId, Query};
|
||||
use crate::{ide_db::RootDatabase, Query};
|
||||
|
||||
#[salsa::query_group(SymbolsDatabaseStorage)]
|
||||
pub(crate) trait SymbolsDatabase: hir::db::HirDatabase {
|
||||
@ -115,7 +115,7 @@ pub(crate) fn index_resolve(db: &RootDatabase, name_ref: &ast::NameRef) -> Vec<F
|
||||
let mut query = Query::new(name.to_string());
|
||||
query.exact();
|
||||
query.limit(4);
|
||||
crate::symbol_index::world_symbols(db, query)
|
||||
world_symbols(db, query)
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
@ -3,8 +3,8 @@
|
||||
|
||||
use crate::{
|
||||
db::RootDatabase,
|
||||
ide_db::symbol_index::{self, FileSymbol},
|
||||
references::{classify_name, NameDefinition, NameKind},
|
||||
symbol_index::{self, FileSymbol},
|
||||
Query,
|
||||
};
|
||||
use hir::{db::HirDatabase, ModuleDef, SourceBinder};
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
mod db;
|
||||
pub mod mock_analysis;
|
||||
mod symbol_index;
|
||||
mod change;
|
||||
mod source_change;
|
||||
|
||||
@ -59,7 +58,11 @@
|
||||
};
|
||||
use ra_syntax::{SourceFile, TextRange, TextUnit};
|
||||
|
||||
use crate::{db::LineIndexDatabase, display::ToNav, symbol_index::FileSymbol};
|
||||
use crate::{
|
||||
db::LineIndexDatabase,
|
||||
display::ToNav,
|
||||
ide_db::symbol_index::{self, FileSymbol},
|
||||
};
|
||||
|
||||
pub use crate::{
|
||||
assists::{Assist, AssistId},
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
use crate::{
|
||||
db::RootDatabase,
|
||||
symbol_index::{LibrarySymbolsQuery, SymbolIndex},
|
||||
ide_db::symbol_index::{LibrarySymbolsQuery, SymbolIndex},
|
||||
FileId,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user