Package-level declarations

Types

Link copied to clipboard
@Serializable
data class PersistedBinding(val variable: String, val value: String)

Mirrors BindingPresentation's shape for JSON persistence.

Link copied to clipboard
@Serializable
data class PersistedDocument(val displayName: String, val text: String, val originProviderId: String? = null, val originReference: String? = null, val dirty: Boolean = false, val isScratch: Boolean = false, val query: String = "", val queryHistory: List<String> = emptyList(), val fontSize: Int? = null, val resolutions: List<PersistedResolution> = emptyList())

One page's persisted state: the document it holds (or scratch text), its query/history, and its resolutions - everything restoreWorkspace needs to recreate the page without re-running anything.

Link copied to clipboard
@Serializable
data class PersistedResolution(val query: String, val solutions: List<PersistedSolution>, val terminalStatus: String, val error: String? = null)

Mirrors ResolutionHistoryEntry's shape for JSON persistence; converted back via toResolutionHistoryEntry.

Link copied to clipboard
@Serializable
sealed interface PersistedSolution

Mirrors SolutionPresentation's shape for JSON persistence; converted back via toSolutionPresentation.

Link copied to clipboard
@Serializable
data class PersistedWorkspace(val fontSize: Int = 14, val windowWidth: Int? = null, val windowHeight: Int? = null, val windowX: Int? = null, val windowY: Int? = null, val selectedIndex: Int = -1, val documents: List<PersistedDocument> = emptyList(), val lookAndFeel: String? = null)

The whole persisted application state - shared shape and capture/restore logic every frontend (ide-swing, ide-web, ...) can build on, regardless of how each actually stores it (a file, localStorage, ...).

Functions

Link copied to clipboard
fun capturePersistedWorkspace(state: GuiState, fontSize: Int, pageFontSizes: Map<PageId, Int> = emptyMap(), windowWidth: Int? = null, windowHeight: Int? = null, windowX: Int? = null, windowY: Int? = null, lookAndFeel: String? = null): PersistedWorkspace

Captures the pages currently open in state as a PersistedWorkspace, ready to save - shared by every frontend (ide-swing, ide-web, ...) regardless of how it actually stores the result (a file, localStorage, ...). pageFontSizes is consulted for each page's own zoom level, where the frontend supports one, falling back to the workspace-wide fontSize when a page never had its own; windowWidth/windowHeight/windowX/ windowY/lookAndFeel are left to null by frontends with no window or look-and-feel concept (e.g. ide-web).

Link copied to clipboard
suspend fun restoreWorkspace(persisted: PersistedWorkspace, controller: GuiController)

Replays a previously-captured PersistedWorkspace as workspace/page actions against controller - every document, each with its query, query history, and resolution/Solutions-tree history. Applying the workspace's look-and-feel, window bounds, and each page's own editor zoom level (where the frontend has any of those) is frontend-specific and left to the caller; this function only touches the toolkit-neutral GuiController state.

Link copied to clipboard

Converts to the persisted, JSON-serializable shape.

Link copied to clipboard

ResolutionStatus.COMPLETED is the safe fallback for a status name this build no longer recognizes.