Repository navigation
v0.4.0 Migrate to unified object-oriented symbol model (v0.4.0)
Refactor core & migrate to unified object-oriented symbol model
BREAKING CHANGE: Completely redesigned internal symbol storage from flat dictionaries
to typed object registries (VariableSymbol, LabelSymbol, ScreenSymbol, ImageSymbol).
Cache structure updated; bump engine version to 0.4.0.
Summary of changes:
-
Architecture:
- Created
senpy/symbols.pyfeaturing dedicated dataclasses:
VariableSymbol,LabelSymbol,ScreenSymbol, andImageSymbol. - Refactored
FileScope(models.py) andSenpyAnalyzer(analyzer.py),
eliminating 13+ fragmented flat dictionaries and sets (declared_labels,
declared_screens,symbol_declarations,symbol_types,defined_constants, etc.)
in favor of 4 unified registries:variables,labels,screens, andimages. - Streamlined
_rebuild_aggregates()boilerplate by ~60%, drastically improving
maintainability and reducing cache desynchronization risks.
- Created
-
Consumers & Integrations:
- Refactored LSP Server (
server.py) methods:completions,definition,
hover, anddocument_symbolsto directly consume the new symbol registries. - Updated Story Flow Analyzer (
flow.py) and Mermaid graph export to inspect
LabelSymbolproperties directly. - Modernized
checkers.py,python_ast.py,wiki.py,stubs.py, andcache.py
to work natively with object models.
- Refactored LSP Server (
-
Reliability & PEP 8:
- Replaced broad
contextlib.suppress(Exception)with specific, narrowed
exception tuples (SyntaxError,ValueError,TypeError,OSError,pickle.PickleError,zlib.error)
insignature.pyandcli.py.
- Replaced broad
-
Tests:
- Updated test assertions across
tests/test_analyzer.pyandtests/test_lsp.py. - All 54 test suites passing cleanly (0.90s).
- Updated test assertions across