diff --git a/crates/red_knot_python_semantic/src/semantic_index/symbol.rs b/crates/red_knot_python_semantic/src/semantic_index/symbol.rs index f8817cc02f..07cfb1a61e 100644 --- a/crates/red_knot_python_semantic/src/semantic_index/symbol.rs +++ b/crates/red_knot_python_semantic/src/semantic_index/symbol.rs @@ -261,7 +261,7 @@ impl ScopeKind { } /// Symbol table for a specific [`Scope`]. -#[derive(Debug, Default, salsa::Update)] +#[derive(Default, salsa::Update)] pub struct SymbolTable { /// The symbols in this scope. symbols: IndexVec, @@ -322,6 +322,16 @@ impl PartialEq for SymbolTable { impl Eq for SymbolTable {} +impl std::fmt::Debug for SymbolTable { + /// Exclude the `symbols_by_name` field from the debug output. + /// It's very noisy and not useful for debugging. + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_tuple("SymbolTable") + .field(&self.symbols) + .finish_non_exhaustive() + } +} + #[derive(Debug, Default)] pub(super) struct SymbolTableBuilder { table: SymbolTable,