less verbose debug for library data

This commit is contained in:
Aleksey Kladov 2018-12-22 11:57:42 +03:00
parent 2639997973
commit 94241cec04
2 changed files with 14 additions and 1 deletions

View file

@ -368,13 +368,22 @@ impl Analysis {
}
}
#[derive(Debug)]
pub struct LibraryData {
root_id: SourceRootId,
root_change: RootChange,
symbol_index: SymbolIndex,
}
impl fmt::Debug for LibraryData {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("LibraryData")
.field("root_id", &self.root_id)
.field("root_change", &self.root_change)
.field("n_symbols", &self.symbol_index.len())
.finish()
}
}
impl LibraryData {
pub fn prepare(
root_id: SourceRootId,

View file

@ -56,6 +56,10 @@ impl Hash for SymbolIndex {
}
impl SymbolIndex {
pub(crate) fn len(&self) -> usize {
self.symbols.len()
}
pub(crate) fn for_files(
files: impl ParallelIterator<Item = (FileId, SourceFileNode)>,
) -> SymbolIndex {