aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/symbol_index.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/symbol_index.rs')
-rw-r--r--crates/ra_ide_api/src/symbol_index.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs
index 414327ac2..94fe1d6d7 100644
--- a/crates/ra_ide_api/src/symbol_index.rs
+++ b/crates/ra_ide_api/src/symbol_index.rs
@@ -24,6 +24,7 @@ use std::{
24 hash::{Hash, Hasher}, 24 hash::{Hash, Hasher},
25 sync::Arc, 25 sync::Arc,
26 mem, 26 mem,
27 fmt,
27}; 28};
28 29
29use fst::{self, Streamer}; 30use fst::{self, Streamer};
@@ -113,12 +114,18 @@ pub(crate) fn index_resolve(db: &RootDatabase, name_ref: &ast::NameRef) -> Vec<F
113 crate::symbol_index::world_symbols(db, query) 114 crate::symbol_index::world_symbols(db, query)
114} 115}
115 116
116#[derive(Default, Debug)] 117#[derive(Default)]
117pub(crate) struct SymbolIndex { 118pub(crate) struct SymbolIndex {
118 symbols: Vec<FileSymbol>, 119 symbols: Vec<FileSymbol>,
119 map: fst::Map, 120 map: fst::Map,
120} 121}
121 122
123impl fmt::Debug for SymbolIndex {
124 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
125 f.debug_struct("SymbolIndex").field("n_symbols", &self.symbols.len()).finish()
126 }
127}
128
122impl PartialEq for SymbolIndex { 129impl PartialEq for SymbolIndex {
123 fn eq(&self, other: &SymbolIndex) -> bool { 130 fn eq(&self, other: &SymbolIndex) -> bool {
124 self.symbols == other.symbols 131 self.symbols == other.symbols