Expand description
§WorkspaceDelta
Dispatches $deltaWorkspaceFolders notifications from Mountain to Cocoon
whenever the open workspace folder set mutates. Called by every site that
flips the folder list (boot-time seed, the MountainWorkspaceOpen*
commands, pick-folder navigation, Wind add/remove, and the Cocoon-driven
$updateWorkspaceFolders request).
The delta is computed by
[WorkspaceState::SetWorkspaceFoldersReturnDelta] and shipped as a
fire-and-forget Vine notification: Cocoon’s NotificationHandler converts
it into a didChangeWorkspaceFolders event on
WorkspaceEventEmitter, which powers every extension’s
vscode.workspace.onDidChangeWorkspaceFolders subscription. The same
payload primes the local workspace snapshot in WorkspaceNamespace so
vscode.workspace.workspaceFolders returns the fresh list on subsequent
synchronous reads.
Functions§
- Dispatch
Delta Workspace Folders - Dispatch
$deltaWorkspaceFoldersto Cocoon. Returns immediately if both arrays are empty - no point waking the sidecar for a no-op mutation. - Folder
ToWire 🔒 - Serialisation shape matching the Cocoon-side Workspace shim. Mirrors the
camelCase DTO Sky already serialises for
workspaces:getFolders, so the Cocoon handler can pass the payload through to extension listeners without renaming fields. - Persist
Recently 🔒Opened - Append every folder in
Addedto~/.land/workspaces/RecentlyOpened.json, deduping by URI and capping at 50 entries (the VS Code default). Swallows every error - a failed write must not prevent the workspace change. - Update
Workspace Folders AndBroadcast - Variant that additionally emits a
sky://workspaces/changedTauri event so Wind/Sky can update their own caches (recent-folders list, sidebar breadcrumb) without pollingworkspaces:getFolders. Preferred call site whenever the caller already has anAppHandlein scope. - Update
Workspace Folders AndNotify - Convenience wrapper: update the state and fire the delta in one call.