mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
everysalsa
This commit is contained in:
parent
e69ff21207
commit
fcdf3a52b4
4 changed files with 40 additions and 23 deletions
|
@ -1,3 +1,7 @@
|
|||
use std::{
|
||||
sync::Arc,
|
||||
hash::{Hash, Hasher},
|
||||
};
|
||||
use libeditor::{FileSymbol, file_symbols};
|
||||
use libsyntax2::{
|
||||
File,
|
||||
|
@ -13,6 +17,12 @@ pub(crate) struct SymbolIndex {
|
|||
map: fst::Map,
|
||||
}
|
||||
|
||||
impl Hash for SymbolIndex {
|
||||
fn hash<H: Hasher>(&self, hasher: &mut H) {
|
||||
self.symbols.hash(hasher)
|
||||
}
|
||||
}
|
||||
|
||||
impl SymbolIndex {
|
||||
pub(crate) fn for_files(files: impl ParallelIterator<Item=(FileId, File)>) -> SymbolIndex {
|
||||
let mut symbols = files
|
||||
|
@ -43,7 +53,7 @@ impl SymbolIndex {
|
|||
impl Query {
|
||||
pub(crate) fn search(
|
||||
self,
|
||||
indices: &[&SymbolIndex],
|
||||
indices: &[Arc<SymbolIndex>],
|
||||
token: &JobToken,
|
||||
) -> Vec<(FileId, FileSymbol)> {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue