Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion crates/red_knot_python_semantic/src/semantic_index/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ScopedSymbolId, Symbol>,
Expand Down Expand Up @@ -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,
Expand Down
Loading