Expand description
DebugService: manages debug adapter protocol sessions.
§DebugProvider (Environment)
Implements DebugService for
MountainEnvironment, managing the complete debugging session lifecycle
from configuration to termination. Orchestrates between the extension host
(Cocoon), the debug adapter, and the UI, including DAP (Debug Adapter
Protocol) message mediation.
Uses two-stage registration: configuration providers and adapter descriptor
factories. Each debug type (node, java, rust) can have its own configuration
and adapter. Integrates with
IPCProvider for RPC to Cocoon.
§Debug session flow
- UI calls
StartDebuggingwith folder URI and configuration. - Mountain RPCs to Cocoon to resolve debug configuration (variable substitution).
- Mountain RPCs to Cocoon to create debug adapter descriptor.
- Mountain spawns debug adapter process or connects to TCP server.
- Mountain mediates DAP messages between UI and debug adapter.
- UI sends DAP commands via
SendCommandwhich forwards to adapter. - Debug adapter sends DAP events/notifications back through Mountain to UI.
- Session ends on stop request or adapter process exit.
§Methods
RegisterDebugConfigurationProvider- register config resolverRegisterDebugAdapterDescriptorFactory- register adapter factoryStartDebugging- start debug sessionSendCommand- send DAP command to adapterStopDebugging- graceful DAP disconnect then session unregister
§VS Code reference
vs/workbench/contrib/debug/browser/debugService.tsvs/workbench/contrib/debug/common/debug.tsvs/workbench/contrib/debug/browser/adapter/descriptorFactory.tsvs/debugAdapter/common/debugProtocol.ts