Skip to main content

Module Window

Module Window 

Source
Expand description

Window-domain handlers for CocoonService. Sixteen entry points cover show/hide messages, status-bar items, webview panels, and the prompt family (quick-pick / input-box / progress).

Modules§

CreateStatusBarItem
Register a status-bar entry through the StatusBarProvider trait so the entry lives in ApplicationState::Feature::Markers::ActiveStatusBarItems. Without this registration the workbench has no memory of the entry and the first SetStatusBarText::Fn call rebroadcasts a fresh entry (state leak). Falls back to a direct Sky emit on trait failure.
CreateWebviewPanel
Register a webview panel through the WebviewProvider trait so the panel is tracked in ApplicationState::WebviewState. Without trait registration DisposeWebviewPanel later fails with “unknown handle” and webviews leak DOM. Falls back to a millisecond pseudo-handle and a direct Sky emit on trait failure.
DisposeWebviewPanel
Dispose a webview panel. The Sky listener at SkyBridge.ts:2344 destructures { panelId }; the older sibling emitter at RPC/CocoonService/mod.rs:1235 already uses panelId - keep this site aligned so a dispose from either path lands in the same DOM cel:webview:dispose CustomEvent.
OnDidReceiveMessage
Forward a webview→extension message to Sky on sky://webview/post-message. The protobuf oneof is normalised to a JSON value (string or bytes).
OpenExternal
Forward an OpenExternal request to Sky on sky://native/openExternal so the webview can launch the URI in the system browser/handler.
PostWebviewMessage
Push a message from the extension into the webview via sky://webview/post-message. Canonical kebab-case channel; sky://webview/postMessage has been retired.
ReportProgress
Update a progress notification with a new message + increment.
SetStatusBarText
Update the text of a status-bar entry. Re-issues SetStatusBarEntry so the stored DTO’s Text field is refreshed in ActiveStatusBarItems (HashMap insert acts as create-or-update).
SetWebviewHtml
Update a webview panel’s HTML through the trait so the content is captured in WebviewStateDTO and re-servable on reveal/restore.
ShowErrorMessage
Display an error-severity message via the UserInterfaceProvider.
ShowInformationMessage
Display an info-severity message via the UserInterfaceProvider.
ShowInputBox
Display an input-box UI. Returns cancelled:true with empty value when the user dismisses without confirming.
ShowProgress
Begin a progress notification. Mints a millisecond handle, emits sky://progress/start so the workbench can render the bar.
ShowQuickPick
Display a quick-pick UI through the UserInterfaceProvider. The returned label strings are mapped back to indices via linear search so the proto response can carry stable selected_indices.
ShowTextDocument
Open a document in the workbench. Maps to sky://editor/openDocument (same channel as Workspace::OpenDocument::Fn; this is the window-namespace alias).
ShowWarningMessage
Display a warning-severity message via the UserInterfaceProvider.