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§

ApplyTextEdits
Cocoon → Mountain window.applyTextEdits notification.
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> as a batch; Sky demultiplexes back to per-decoration cel:decoration:* CustomEvents.
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
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
OutputChannelCoalesce
Per-channel coalescing buffer for outputChannel.append notifications.
OutputChannelCreate
OutputChannelDispose
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
OutputClear
OutputCreate
OutputDispose
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
ProgressComplete
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.
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
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.
RegisterLanguageProvider
Handles all register_* / register_*_provider gRPC notifications from the Cocoon extension host. Each such notification wires a language-feature provider into Mountain’s ProviderRegistration keyed on Handle; the language-feature RPC path (e.g. GetHoverAtPosition) then proxies back to Cocoon with the original $providerXxx method.
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.
SetTextEditorDecorations
Cocoon → Mountain window.setTextEditorDecorations notification.
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.
Support
Shared utilities for Cocoon → Mountain notification atoms.
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
authentication provider-unregistration atom.
UnregisterCommand
Cocoon → Mountain unregisterCommand notification. Paired with registerCommand; removes the proxied CommandHandler so subsequent commands.executeCommand no longer routes back to the extension.
UnregisterDebugAdapter
debug_adapter provider-unregistration atom.
UnregisterDebugConfigurationProvider
debug_configuration provider-unregistration atom.
UnregisterFileSystemProvider
unregister_file_system_provider — disposes a scheme-bound FS provider. Logs the scheme so routing mismatches are visible after disposal.
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
task provider-unregistration atom.
UnregisterUriHandler
unregister_uri_handler — disposes a URI-handler provider handle. Logs the optional bound scheme alongside the handle for traceability.
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 / webview.postMessage / webview.updateView / webview.viewState / webview.dispose notifications. Shared atom because the methods all map to the same suffix-split pattern; keeping them in one file avoids 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.