Goal
Introduce a WhamWorkspace that manages the current state of catalogues and rosters, provides lazy per-roster compilation tracking, document identity, and change notifications for UI consumers. Analogous to Roslyn's Workspace / Solution / CompilationTracker infrastructure.
Parent epic: #279
Depends on: #280 (SymbolKey), #281 (Incremental compilation)
Problem
Currently there is no centralized state management above RosterEditor:
RosterEditor manages a single roster with undo/redo
- No concept of "the workspace" containing catalogues + multiple rosters
- No document identity tracking (which source trees changed between versions)
- No lazy compilation rebuilding — everything is eager
- No change notification mechanism for UI consumers to react to state changes
Design
Core Components
WhamWorkspace
├── Loaded catalogues (shared CatalogueCompilation from Phase 2)
├── Per-roster state:
│ ├── CompilationTracker (lazily rebuilds RosterCompilation)
│ ├── RosterEditor (undo/redo stack)
│ └── Document identity (source tree tracking)
├── Change notifications for UI
└── Background diagnostics support
WhamWorkspace Responsibilities
- Catalogue management: Load/unload catalogues, maintain shared CatalogueCompilation
- Roster management: Open/close rosters, each with its own CompilationTracker
- Compilation tracking: Lazily rebuild roster compilations when source trees change
- Document identity: Track which source trees (catalogues, rosters) are loaded, map old↔new across versions
- Change notifications: Event-based notification when compilations change (for UI refresh, background diagnostics)
CompilationTracker (Per-Roster)
Analogous to Roslyn's RegularCompilationTracker:
internal class CompilationTracker
{
// Lazily computed compilation, cached until invalidated
private Lazy<RosterCompilation> lazyCompilation;
// Queue of pending changes (roster tree replacements)
private ImmutableList<TranslationAction> pendingActions;
// Get or compute the current compilation
public RosterCompilation GetCompilation();
// Fork: create a new tracker with a pending change
public CompilationTracker WithRosterTreeChange(SourceTree newTree);
}
Roslyn Analogy
| Roslyn |
Wham |
Workspace |
WhamWorkspace |
Solution |
Immutable snapshot of catalogues + rosters |
Project |
Catalogue or Roster |
Document |
SourceTree |
CompilationTracker |
Per-roster CompilationTracker |
TranslationAction |
Roster tree changes |
DocumentId |
Source tree identity |
Tasks
Goal
Introduce a
WhamWorkspacethat manages the current state of catalogues and rosters, provides lazy per-roster compilation tracking, document identity, and change notifications for UI consumers. Analogous to Roslyn'sWorkspace/Solution/CompilationTrackerinfrastructure.Parent epic: #279
Depends on: #280 (SymbolKey), #281 (Incremental compilation)
Problem
Currently there is no centralized state management above
RosterEditor:RosterEditormanages a single roster with undo/redoDesign
Core Components
WhamWorkspaceResponsibilitiesCompilationTracker(Per-Roster)Analogous to Roslyn's
RegularCompilationTracker:Roslyn Analogy
WorkspaceWhamWorkspaceSolutionProjectDocumentSourceTreeCompilationTrackerCompilationTrackerTranslationActionDocumentIdTasks
WhamWorkspaceAPI (load catalogues, open/close rosters)CompilationTrackerfor lazy per-roster compilation managementCompilationChanged,RosterStateChanged)RosterEditor— workspace-aware editor operations