Skip to main content

Module Notification

Module Notification 

Source
Expand description

Cocoon → Mountain notification atoms. One handler per file so the dispatcher in MountainVinegRPCService::send_cocoon_notification stays a thin match; each wire method lives at Vine::Server::Notification::<Atom>::<Atom> for grep-friendly navigation. See Notification/mod.rs for the contract.

§Vine Cocoon → Mountain Notification Atoms

One handler per file, file name = the exported function name (reverse-hierarchical path: Vine::Server::Notification::<Atom>::<Atom>). Each atom encapsulates exactly one wire-method’s side effects so the main send_cocoon_notification dispatcher in MountainVinegRPCService.rs stays a thin match that routes into these files.

§Naming

  • Wire string outputChannel.create → atom file OutputChannelCreate.rs with pub async fn OutputChannelCreate(...).
  • Wire string unregister_scm_provider → atom file UnregisterScmProvider.rs.
  • Wire string progress.update → atom file ProgressUpdate.rs.

Snake_case / dotted wire strings collapse to PascalCase file names. The function name mirrors the file name verbatim so a grep for fn <Name> lands in exactly one place.

§Signature contract

Every atom takes the same two parameters:

pub async fn <Atom>(
    Service: &MountainVinegRPCService,
    Parameter: &serde_json::Value,
);
  • Service gives access to ApplicationHandle (for Tauri emit / webview lookup) and RunTime (for Environment, ApplicationState, provider registry, scheduler).
  • Parameter is the raw JSON payload Cocoon sent; each atom extracts the fields it needs and validates locally.
  • Return () - atoms that need to fail just log via dev_log! on the notif-drop / grpc tag; the caller always returns Empty to Cocoon because notifications are fire-and-forget.

Modules§

DebugLifecycle
Cocoon → Mountain debug.addBreakpoints / debug.removeBreakpoints / debug.consoleAppend notifications. Fans on sky://debug/<suffix> so the Sky-side debug view picks up breakpoint changes and console output from the extension’s vscode.debug.* surface.
DecorationTypeLifecycle
Cocoon → Mountain window.createTextEditorDecorationType / window.disposeTextEditorDecorationType notifications. Forwards the payload on sky://decoration/<suffix>; Sky’s editor renderer owns the Monaco-side decoration lifecycle so Mountain is a pure relay.
DisposeStatusBarItem
Cocoon → Mountain disposeStatusBarItem notification. Emitted once by Cocoon/.../Services/Window/StatusBar.ts:139 when an extension calls StatusBarItem.dispose() (or the whole subscription set tears down). Forwards onto the canonical sky://statusbar/dispose-entry channel so the Sky shim’s fan-out listener removes the DOM node.
ExtensionActivated
Cocoon → Mountain ExtensionActivated notification. Fires once per extension when its activate export resolves (or finishes registering contributions). Forwarded to Wind on cocoon:extensionActivated so the Extensions sidebar updates its row state without polling.
ExtensionDeactivated
Cocoon → Mountain ExtensionDeactivated notification. Log-only today - Wind listens on cocoon:extensionActivated for the positive half; extensions rarely deactivate at runtime outside uninstall (which fires a separate sky://extensions/uninstalled emit). Kept named so the wire method doesn’t fall to notif-drop.
ExtensionHostMessage
Cocoon → Mountain extensionHostMessage notification. Forwards the extension-host binary protocol reply to Wind via the cocoon:extensionHostReply Tauri event. Wind’s extension-host bridge consumes these replies to complete pending ext-host RPC calls.
LanguagesSetDocumentLanguage
Cocoon → Mountain languages.setDocumentLanguage notification. Emitted when an extension calls vscode.languages.setTextDocumentLanguage(document, languageId). Forwarded verbatim to Sky on sky://languages/setDocumentLanguage so Monaco swaps the language mode on the matching editor.
OpenExternal
Cocoon → Mountain openExternal notification. Emitted by Cocoon/.../APIFactoryService.ts:393 when an extension calls vscode.env.openExternal(uri). Delegates to the platform’s default handler via the opener crate (already a Mountain dep via nativeHost:openExternal). Fire-and-forget; success/failure is logged but not surfaced back to the extension.
OutputAppend
Cocoon → Mountain output.append notification. Emitted by Cocoon/.../Services/Window/OutputChannel.ts:50 whenever an extension calls OutputChannel.append(text). Forwards verbatim to sky://output/append - the Sky listener mirrors the text into both the in-memory OutputChannels map and VS Code’s logger sink.
OutputAppendLine
Cocoon → Mountain output.appendLine notification. Emitted by Cocoon/.../Services/Window/OutputChannel.ts:56 whenever an extension calls OutputChannel.appendLine(text). The stock semantic contract is “append + trailing \n”; we suffix the newline here so the downstream sky://output/append listener stays a single append code path (no appendLine listener in Sky).
OutputChannelAppend
Cocoon → Mountain outputChannel.append notification. Twin of output.append; see OutputCreate.rs for the duplicate-wire rationale.
OutputChannelClear
Cocoon → Mountain outputChannel.clear notification (twin of output.clear).
OutputChannelCreate
Cocoon → Mountain outputChannel.create notification. Parallel wire name to output.create used by Cocoon’s SendToMountain call sites. The two should converge to one in a future Cocoon refactor; for now Mountain handles both by routing into the same sky://output/create channel.
OutputChannelDispose
Cocoon → Mountain outputChannel.dispose notification (twin of output.dispose).
OutputChannelHide
Cocoon → Mountain outputChannel.hide notification. Stock VS Code exposes OutputChannel.hide() as a counterpart to show(). Sky doesn’t yet render a dismissable panel per-channel, so the signal currently no-ops to a tagged log line. Kept explicit so the wire name doesn’t fall through to notif-drop on every extension-driven hide.
OutputChannelShow
Cocoon → Mountain outputChannel.show notification (twin of output.show).
OutputClear
Cocoon → Mountain output.clear notification. Forwarding atom for OutputChannel.clear() - the Sky listener resets the in-memory buffer for the matching channel.
OutputCreate
Cocoon → Mountain output.create notification. Emitted by Cocoon/.../Services/Window/OutputChannel.ts:39 once per vscode.window.createOutputChannel(name) call. Re-emits on the canonical sky://output/create channel the Sky OutputChannels map already listens for.
OutputDispose
Cocoon → Mountain output.dispose notification. Forwarding atom for OutputChannel.dispose() - removes the channel from Sky’s OutputChannels map.
OutputReplace
Cocoon → Mountain output.replace notification. Emitted when an extension calls LogOutputChannel.replace(value) to swap the channel’s entire contents. Sky doesn’t yet have a dedicated sky://output/replace listener, so this atom maps replace → (clear + append) on the existing channels. That preserves semantics without requiring a coordinated Sky-side change.
OutputShow
Cocoon → Mountain output.show notification. Forwarding atom for OutputChannel.show(preserveFocus?).
ProgressComplete
Cocoon → Mountain progress.complete notification. Fires once vscode.window.withProgress(...) settles - either the task finishes or Cocoon cancels it. Canonical counterpart to Mountain’s already-handled progress.end; this atom re-routes onto the sky://progress/end channel so the renderer’s progress indicator tears down regardless of which wire name Cocoon picked.
ProgressEnd
Cocoon → Mountain progress.end notification. Fires once per vscode.window.withProgress(...) call when the task settles. Forwarded onto sky://notification/progress-end so Sky’s progress indicator tears down.
ProgressReport
Cocoon → Mountain progress.report notification. Fires on every Progress.report({ message, increment }) callback within a vscode.window.withProgress(...) run. The git extension alone fires 6000+ of these per session during repository scans; emitting one Tauri event per call saturates the WKWebView IPC channel that also delivers keystrokes. Each event is coalesced into a 16ms (one frame) window per Progress handle, accumulating increment deltas and keeping the most recent non-empty message. Sky sees one update per frame per progress operation instead of dozens, with the same final cumulative state.
ProgressStart
Cocoon → Mountain progress.start notification. Fires at the top of every vscode.window.withProgress(...) call. Normalises onto sky://notification/progress-begin so Sky’s progress indicator renders identically whether an extension or a Mountain handler triggered the progress.
ProgressUpdate
Cocoon → Mountain progress.update notification. Cocoon’s Services/Window/Progress.ts:56 emits this on every Progress.report({ message, increment }) callback during an extension’s vscode.window.withProgress(...) invocation. Stock Mountain already handles progress.report with identical payload semantics; this atom funnels into the same sky:// channel so the notification-surface name mismatch (update vs report) doesn’t leak into the renderer contract.
RegisterCommand
Cocoon → Mountain registerCommand notification. Stores the command as a Proxied handler in Mountain’s CommandRegistry so subsequent commands.executeCommand calls get routed back to Cocoon via $executeContributedCommand gRPC. The sidecar identifier is hard-coded to cocoon-main because that is the sole extension-host Cocoon instance today.
RegisterScmProvider
Cocoon → Mountain register_scm_provider notification.
RegisterScmResourceGroup
Cocoon → Mountain register_scm_resource_group notification.
SecurityIncident
Cocoon → Mountain security.incident notification. Emitted by Cocoon/.../Services/SecurityService.ts:284 when the Cocoon-side security policy flags a policy breach (extension violated its declared permission set, blocked filesystem access, etc.). Land has no central security dashboard yet, so the atom surfaces the incident via dev_log! on the grpc tag and re-emits on sky://security/incident for any future Sky listener.
SetLanguageConfiguration
Cocoon → Mountain set_language_configuration notification. Emitted by Cocoon/.../APIFactoryService.ts:557 when an extension calls vscode.languages.setLanguageConfiguration(languageId, config). Carries brackets / indent rules / word-pattern / comments. Forwards on sky://language/configure; Monaco’s config side reads the payload and calls monaco.languages.setLanguageConfiguration(...).
SetStatusBarText
Cocoon → Mountain setStatusBarText notification. Emitted three times by Cocoon/.../Services/Window/StatusBar.ts (:92, :123, :131) whenever an extension calls vscode.window.setStatusBarMessage(...), or an extension-owned StatusBarItem.text = "..." mutates. Distinct from the typed statusBar.update notification (which carries colour/tooltip/command fields): this wire form is the pure text-only fast path.
StatusBarLifecycle
Cocoon → Mountain statusBar.update / statusBar.dispose notifications. Each vscode.window.createStatusBarItem(...) instance fires statusBar.update with text / tooltip / alignment; statusBar.dispose removes the item. Sky’s workbench status-bar renderer subscribes to the downstream sky://statusbar/* family.
StatusBarMessage
Cocoon → Mountain statusBar.message notification. Emitted when an extension calls vscode.window.setStatusBarMessage (one-shot text, optional auto-hide). Canonical channel is sky://statusbar/set-message.
TerminalLifecycle
Cocoon → Mountain terminal.sendText / terminal.show / terminal.hide / terminal.dispose notifications. Shared atom because the four wire methods all fan through the same sky://terminal/* relay and the same provider-side PTY drive, differing only in which provider call fires (sendText vs dispose) and whether the payload carries text.
UnregisterAuthenticationProvider
Cocoon → Mountain unregister_authentication_provider notification. Emitted by Cocoon/.../AuthenticationNamespace.ts:43 when an extension disposes an authentication provider handle. Removes the matching ProviderRegistrationDTO so stale provider state doesn’t pin memory or shadow a later re-register.
UnregisterCommand
Cocoon → Mountain unregisterCommand notification. Paired with registerCommand; removes the proxied CommandHandler so subsequent commands.executeCommand no longer routes back to the extension.
UnregisterDebugAdapter
Cocoon → Mountain unregister_debug_adapter notification. Emitted by Cocoon/.../DebugNamespace.ts:38 when an extension disposes a debug adapter descriptor factory. Mirrors UnregisterAuthenticationProvider but for the DebugAdapter slot.
UnregisterFileSystemProvider
Cocoon → Mountain unregister_file_system_provider notification. Emitted by Cocoon/.../WorkspaceNamespace/Providers.ts:78 on FileSystemProvider disposal. Scheme-bound: the paired register_file_system_provider stores the scheme in the provider selector so filesystem router lookups stop routing to this handle.
UnregisterScmProvider
Cocoon → Mountain unregister_scm_provider notification. Emitted by Cocoon/.../ScmNamespace.ts:82 when vscode.scm.createSourceControl(...).dispose() fires. The paired RegisterScmProvider typed gRPC (RPC/CocoonService/SCM.rs) derives the handle as a DJB-style hash of the scmId; we recompute the same hash here so unregister cleans up the exact entry RegisterScmProvider stored without needing Cocoon to hand the u32 back over the wire.
UnregisterTaskProvider
Cocoon → Mountain unregister_task_provider notification. Emitted by Cocoon/.../TasksNamespace.ts:35 when vscode.tasks.registerTaskProvider(...).dispose() fires.
UnregisterUriHandler
Cocoon → Mountain unregister_uri_handler notification. Emitted by Cocoon/.../WindowNamespace.ts:786 when vscode.window.registerUriHandler(...).dispose() fires. Carries the handle the paired register_uri_handler stored and (optionally) the scheme bound to it.
UpdateScmGroup
Cocoon → Mountain update_scm_group notification.
WebviewDispose
Cocoon → Mountain webview.dispose notification. Emitted by Cocoon/.../Services/Window/WebviewPanel.ts:155 when the extension disposes a webview panel or the user closes the tab. Sky’s webview shim listens on sky://webview/dispose and tears down the DOM container + unregisters the handle lookup.
WebviewLifecycle
Cocoon → Mountain webview.setTitle / webview.setIconPath / webview.setHtml notifications. Shared atom because the three wire methods map to the same suffix-split pattern; keeping them in one file avoids three near-identical 5-line files while still pinning the handler to a discoverable filename.
WebviewPostMessage
Cocoon → Mountain webview.postMessage notification. Emitted by Cocoon/.../Services/Window/WebviewPanel.ts:125 when an extension calls WebviewPanel.webview.postMessage(...). Stock VS Code delivers this as a DOM message event inside the webview iframe; in Land we emit on sky://webview/postMessage and let the Sky bridge relay into the specific webview DOM container keyed on { handle, message }.
WebviewReady
Cocoon → Mountain WebviewReady notification. Fires when a webview the extension owns has finished loading its entry HTML. Log-only today - Sky’s webview shim handles the DOM-side readiness independently. Kept named so the wire method is observable and doesn’t fall to notif-drop.
WindowCreateTerminal
Cocoon → Mountain window.createTerminal notification. Fire-and-forget from Cocoon’s vscode.window.createTerminal(...) shim. Spawns the PTY via the registered TerminalProvider so the xterm panel starts receiving data immediately, then emits sky://terminal/create with the provider-minted id/pid/name so Sky can correlate the panel with the extension-owned terminal instance.
WindowShowMessage
Cocoon → Mountain window.showMessage notification. Fires when an extension calls vscode.window.showInformationMessage / showWarningMessage / showErrorMessage. Forwards on sky://notification/show so the toast stack renders without a round-trip back to Cocoon.
WindowShowTextDocument
Cocoon → Mountain window.showTextDocument notification. Fires when an extension calls vscode.window.showTextDocument(uri, options). Extension activation commonly uses this for “jump to definition” and “reveal config”. Forwarded on sky://window/showTextDocument.
WorkspaceApplyEdit
Cocoon → Mountain workspace.applyEdit notification. Fires when an extension calls vscode.workspace.applyEdit(edit) with a multi-file WorkspaceEdit. The payload shape matches VS Code’s IWorkspaceEdit; Sky’s BulkEditService applies the edits against open models.