aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-12-22 09:47:54 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-12-22 09:47:54 +0000
commit696246af7f4d17054c1caa80592cc0b858746260 (patch)
tree57e252955404bba9978f3a3a3c288a0636a87173 /crates/ra_analysis/src
parent82e3ab02afee7cc0db178e1b10ee65146e4b7a14 (diff)
parent90f20f8c539843f53a7a2b1cfb83b3673ec78534 (diff)
Merge #321
321: More useful logging r=matklad a=matklad Try not to log *huge* messages, to make logging more useful. Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r--crates/ra_analysis/src/lib.rs11
-rw-r--r--crates/ra_analysis/src/symbol_index.rs4
2 files changed, 14 insertions, 1 deletions
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs
index 6fd157880..85df9c089 100644
--- a/crates/ra_analysis/src/lib.rs
+++ b/crates/ra_analysis/src/lib.rs
@@ -368,13 +368,22 @@ impl Analysis {
368 } 368 }
369} 369}
370 370
371#[derive(Debug)]
372pub struct LibraryData { 371pub struct LibraryData {
373 root_id: SourceRootId, 372 root_id: SourceRootId,
374 root_change: RootChange, 373 root_change: RootChange,
375 symbol_index: SymbolIndex, 374 symbol_index: SymbolIndex,
376} 375}
377 376
377impl fmt::Debug for LibraryData {
378 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
379 f.debug_struct("LibraryData")
380 .field("root_id", &self.root_id)
381 .field("root_change", &self.root_change)
382 .field("n_symbols", &self.symbol_index.len())
383 .finish()
384 }
385}
386
378impl LibraryData { 387impl LibraryData {
379 pub fn prepare( 388 pub fn prepare(
380 root_id: SourceRootId, 389 root_id: SourceRootId,
diff --git a/crates/ra_analysis/src/symbol_index.rs b/crates/ra_analysis/src/symbol_index.rs
index b48a37229..e5bdf0aa1 100644
--- a/crates/ra_analysis/src/symbol_index.rs
+++ b/crates/ra_analysis/src/symbol_index.rs
@@ -56,6 +56,10 @@ impl Hash for SymbolIndex {
56} 56}
57 57
58impl SymbolIndex { 58impl SymbolIndex {
59 pub(crate) fn len(&self) -> usize {
60 self.symbols.len()
61 }
62
59 pub(crate) fn for_files( 63 pub(crate) fn for_files(
60 files: impl ParallelIterator<Item = (FileId, SourceFileNode)>, 64 files: impl ParallelIterator<Item = (FileId, SourceFileNode)>,
61 ) -> SymbolIndex { 65 ) -> SymbolIndex {