Skip to content

Conversation

carljm
Copy link
Contributor

@carljm carljm commented Jun 5, 2024

Summary

Separate SymbolTable and FlowGraph into their own modules, and make both submodules of red_knot::semantic module. Also move types module into semantic.

red_knot::semantic::SemanticIndexer builds a SemanticIndex (consisting of the symbol table and flow graph). The symbol_table query is now semantic_index, and SymbolTablesStorage is SemanticIndexStorage.

Both SymbolTable and FlowGraph are immutable, and constructed using a separate builder.

Fixes #11657.

Test Plan

Refactor; existing tests pass.

@carljm carljm added the ty Multi-file analysis & type inference label Jun 5, 2024
@carljm carljm requested a review from MichaReiser as a code owner June 5, 2024 00:43
Copy link
Contributor

github-actions bot commented Jun 5, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. I like this a lot. It makes the symbol module much more approachable.

@carljm carljm merged commit 895eb3e into main Jun 5, 2024
@carljm carljm deleted the cjm/refactor branch June 5, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ty Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[red-knot] symbol table should not own the flow graph
2 participants