Skip to main content

Module WorkspaceFolderCommand

Module WorkspaceFolderCommand 

Source
Expand description

§WorkspaceFolderCommand

Tauri commands for opening, listing, and closing workspace folders at runtime. These are the second half of Plan BATCH-02: the first half (autoload at startup) seeds ApplicationState.Workspace.WorkspaceFolders from CLI / env. These commands let Sky drive the same state change after boot, for a welcome-screen “Open Folder” button or a recent-files picker.

§Flow

Sky clicks "Open Folder" ──invoke──> MountainWorkspaceOpenFolder
                                          │
                                          ▼
            ApplicationState.Workspace.SetWorkspaceFolders(...)
                                          │
                                          ├── UpdateWorkspaceFoldersRequest
                                          ▼        (to Cocoon via gRPC)
          extensions see new `vscode.workspace.workspaceFolders`
          and receive `onDidChangeWorkspaceFolders`.

The command deliberately validates the path before touching state: a non-existent directory (user fat-fingered a drag, for instance) returns an error and the existing folder set is untouched.

Structs§

WorkspaceFolderPayload
JSON-serialisable record returned to Sky for every folder in the set.

Functions§

MountainWorkspaceCloseAllFolders
Close every workspace folder - equivalent to VS Code’s workbench.action.closeFolder. Extensions that subscribe to onDidChangeWorkspaceFolders receive an event whose removed array contains every previously-open folder.
MountainWorkspaceListFolders
Return the current workspace folder set without mutating anything.
MountainWorkspaceOpenFolder
Open one or more workspace folders, replacing any currently-open set.