From d1c982d3c7796e1676a2cbec6eda5c3a80fd56f9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 5 Mar 2019 17:09:48 +0300 Subject: [PATCH] dont produce giant debug dumps --- crates/ra_ide_api/src/symbol_index.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index 414327ac227..94fe1d6d7d1 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -24,6 +24,7 @@ hash::{Hash, Hasher}, sync::Arc, mem, + fmt, }; use fst::{self, Streamer}; @@ -113,12 +114,18 @@ pub(crate) fn index_resolve(db: &RootDatabase, name_ref: &ast::NameRef) -> Vec, map: fst::Map, } +impl fmt::Debug for SymbolIndex { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("SymbolIndex").field("n_symbols", &self.symbols.len()).finish() + } +} + impl PartialEq for SymbolIndex { fn eq(&self, other: &SymbolIndex) -> bool { self.symbols == other.symbols