Skip to main content

Module RegisterScmProvider

Module RegisterScmProvider 

Source
Expand description

Cocoon โ†’ Mountain register_scm_provider notification.

Replaces the previous behaviour where this wire-method fell through the language-providers OR-block in MountainVinegRPCService.rs and got registered as a ProviderType::SourceControl language provider (wrong - the SCM viewlet binds to ApplicationState::SourceControl, not the language-feature provider registry, so the panel stayed empty even though vscode.scm.createSourceControl(...) succeeded inside Cocoon).

Cocoon emits this from ScmNamespace.ts:14 with payload shape:

โ“˜
{ handle: u32, id, label, root_uri, extension_id }

Three side effects happen here:

  1. ProviderRegistration::RegisterProvider records the handle so future language-feature dispatches that look up by SCM handle (rare but possible) resolve.
  2. SourceControlManagementProvider::CreateSourceControl mutates ApplicationState::Feature::Markers::SourceControlManagementProviders and emits SkyEvent::SCMProviderAdded - this is the canonical state-tracking path the SCM view uses.
  3. A direct sky://scm/register Tauri emit covers any renderer path that listens for the simpler legacy event shape (gitlens, future custom SCM views).

All three are best-effort and independent: the trait call may fail when root_uri is missing (extensions occasionally register an SCM before opening a folder); the registry write is infallible; the Sky emit is fire-and-forget.

Functionsยง

RegisterScmProvider