Skip to content

Commit ad247aa

Browse files
committed
Move symbol_index
1 parent ec95152 commit ad247aa

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

crates/ra_ide/src/change.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc_hash::FxHashMap;
1515

1616
use crate::{
1717
db::{DebugData, RootDatabase},
18-
symbol_index::{SymbolIndex, SymbolsDatabase},
18+
ide_db::symbol_index::{SymbolIndex, SymbolsDatabase},
1919
};
2020

2121
#[derive(Default)]

crates/ra_ide/src/goto_definition.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use crate::{
1212
db::RootDatabase,
1313
display::{ShortLabel, ToNav},
1414
expand::descend_into_macros,
15+
ide_db::symbol_index,
1516
references::{classify_name_ref, NameKind::*},
1617
FilePosition, NavigationTarget, RangeInfo,
1718
};
@@ -94,7 +95,7 @@ pub(crate) fn reference_definition(
9495
};
9596

9697
// Fallback index based approach:
97-
let navs = crate::symbol_index::index_resolve(sb.db, name_ref.value)
98+
let navs = symbol_index::index_resolve(sb.db, name_ref.value)
9899
.into_iter()
99100
.map(|s| s.to_nav(sb.db))
100101
.collect();

crates/ra_ide/src/ide_db/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
pub mod line_index;
44
pub mod line_index_utils;
55
pub mod feature_flags;
6+
pub mod symbol_index;
67

78
use std::sync::Arc;
89

@@ -13,9 +14,8 @@ use ra_db::{
1314
};
1415
use rustc_hash::FxHashMap;
1516

16-
use crate::{
17-
ide_db::{feature_flags::FeatureFlags, line_index::LineIndex},
18-
symbol_index::{self, SymbolsDatabase},
17+
use crate::ide_db::{
18+
feature_flags::FeatureFlags, line_index::LineIndex, symbol_index::SymbolsDatabase,
1919
};
2020

2121
#[salsa::database(

crates/ra_ide/src/symbol_index.rs renamed to crates/ra_ide/src/ide_db/symbol_index.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use std::{
2929
use fst::{self, Streamer};
3030
use ra_db::{
3131
salsa::{self, ParallelDatabase},
32-
SourceDatabaseExt, SourceRootId,
32+
FileId, SourceDatabaseExt, SourceRootId,
3333
};
3434
use ra_syntax::{
3535
ast::{self, NameOwner},
@@ -40,7 +40,7 @@ use ra_syntax::{
4040
#[cfg(not(feature = "wasm"))]
4141
use rayon::prelude::*;
4242

43-
use crate::{db::RootDatabase, FileId, Query};
43+
use crate::{ide_db::RootDatabase, Query};
4444

4545
#[salsa::query_group(SymbolsDatabaseStorage)]
4646
pub(crate) trait SymbolsDatabase: hir::db::HirDatabase {
@@ -115,7 +115,7 @@ pub(crate) fn index_resolve(db: &RootDatabase, name_ref: &ast::NameRef) -> Vec<F
115115
let mut query = Query::new(name.to_string());
116116
query.exact();
117117
query.limit(4);
118-
crate::symbol_index::world_symbols(db, query)
118+
world_symbols(db, query)
119119
}
120120

121121
#[derive(Default)]

crates/ra_ide/src/imports_locator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
44
use crate::{
55
db::RootDatabase,
6+
ide_db::symbol_index::{self, FileSymbol},
67
references::{classify_name, NameDefinition, NameKind},
7-
symbol_index::{self, FileSymbol},
88
Query,
99
};
1010
use hir::{db::HirDatabase, ModuleDef, SourceBinder};

crates/ra_ide/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ mod ide_db;
1414

1515
mod db;
1616
pub mod mock_analysis;
17-
mod symbol_index;
1817
mod change;
1918
mod source_change;
2019

@@ -59,7 +58,11 @@ use ra_db::{
5958
};
6059
use ra_syntax::{SourceFile, TextRange, TextUnit};
6160

62-
use crate::{db::LineIndexDatabase, display::ToNav, symbol_index::FileSymbol};
61+
use crate::{
62+
db::LineIndexDatabase,
63+
display::ToNav,
64+
ide_db::symbol_index::{self, FileSymbol},
65+
};
6366

6467
pub use crate::{
6568
assists::{Assist, AssistId},

crates/ra_ide/src/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use ra_syntax::{ast, Parse, SyntaxNode};
1515

1616
use crate::{
1717
db::RootDatabase,
18-
symbol_index::{LibrarySymbolsQuery, SymbolIndex},
18+
ide_db::symbol_index::{LibrarySymbolsQuery, SymbolIndex},
1919
FileId,
2020
};
2121

0 commit comments

Comments
 (0)