debug: update visualizers tree proposal, some initial implementation (#204877)

This commit is contained in:
Connor Peet
2024-02-13 18:22:06 +01:00
committed by GitHub
parent 1f57cd8267
commit a2c91f1f28
15 changed files with 640 additions and 92 deletions
@@ -30,6 +30,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
private readonly _debugAdapterDescriptorFactories: Map<number, IDebugAdapterDescriptorFactory>;
private readonly _extHostKnownSessions: Set<DebugSessionUUID>;
private readonly _visualizerHandles = new Map<string, IDisposable>();
private readonly _visualizerTreeHandles = new Map<string, IDisposable>();
constructor(
extHostContext: IExtHostContext,
@@ -112,6 +113,20 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
this.sendBreakpointsAndListen();
}
$registerDebugVisualizerTree(treeId: string, canEdit: boolean): void {
this.visualizerService.registerTree(treeId, {
disposeItem: id => this._proxy.$disposeVisualizedTree(id),
getChildren: e => this._proxy.$getVisualizerTreeItemChildren(treeId, e),
getTreeItem: e => this._proxy.$getVisualizerTreeItem(treeId, e),
editItem: canEdit ? ((e, v) => this._proxy.$editVisualizerTreeItem(e, v)) : undefined
});
}
$unregisterDebugVisualizerTree(treeId: string): void {
this._visualizerTreeHandles.get(treeId)?.dispose();
this._visualizerTreeHandles.delete(treeId);
}
$registerDebugVisualizer(extensionId: string, id: string): void {
const handle = this.visualizerService.register({
extensionId: new ExtensionIdentifier(extensionId),