Skip to content

Commit 4a742ea

Browse files
feat(Sky): Add debug DAP message and custom editor save event handlers
Add two new SkyBridge handlers to bridge VS Code workbench services: 1. `sky://debug/dap-message` - Forwards parsed DAP frames from Mountain's spawned debug-adapter stdout into a `cel:debug:dap-message` DOM event. This enables a future RawDebugSession shim to subscribe and correlate responses by `request_seq` without re-implementing DAP framing. 2. `sky://customEditor/saved` - Dispatches `cel:customEditor:saved` after Mountain's `OnSaveCustomDocument` reverse-RPC succeeds. While the workbench's dirty indicator updates via `IFileService.writeFile`, observers like gitlens diff overlays listen for this explicit "extension save callback completed" signal. Both handlers integrate with the existing custom event system, extending the bridge pattern established by recent SCM and debug session lifecycle handlers.
1 parent f0fabc6 commit 4a742ea

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Source/Function/SkyBridge.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,6 +2255,30 @@ export async function InstallSkyBridge(): Promise<void> {
22552255
);
22562256
});
22572257

2258+
// Forward parsed DAP frames from the spawned debug-adapter's stdout
2259+
// (Mountain `Environment/DebugProvider.rs::StartDebugging` stdout-reader
2260+
// task) into a `cel:debug:dap-message` DOM event. The workbench's
2261+
// `RawDebugSession` correlates responses by `request_seq`; routing the
2262+
// raw `{ sessionId, message }` shape here lets a future RawDebugSession
2263+
// shim subscribe and forward without re-implementing DAP framing.
2264+
await Register("sky://debug/dap-message", (Payload: any) => {
2265+
document.dispatchEvent(
2266+
new CustomEvent("cel:debug:dap-message", { detail: Payload }),
2267+
);
2268+
});
2269+
2270+
// Custom editor save lifecycle: Mountain emits `sky://customEditor/saved`
2271+
// after `OnSaveCustomDocument` reverse-RPC succeeds. Workbench's dirty-
2272+
// indicator already updates from the `IFileService.writeFile` flow the
2273+
// extension drives, but observers (gitlens diff overlays, change-tracking
2274+
// surfaces) listen on `cel:customEditor:saved` for the explicit
2275+
// "extension save callback completed" signal.
2276+
await Register("sky://customEditor/saved", (Payload: any) => {
2277+
document.dispatchEvent(
2278+
new CustomEvent("cel:customEditor:saved", { detail: Payload }),
2279+
);
2280+
});
2281+
22582282
// ---- Webview extensions ----
22592283
// Extension-initiated webview content updates. The canonical channel
22602284
// is the kebab-case `sky://webview/set-html` (see `SkyEvent.ts` for

0 commit comments

Comments
 (0)