11import { DebugProtocol } from "@vscode/debugprotocol" ;
22import * as vscode from "vscode" ;
33
4+ export interface LLDBDapCapabilities extends DebugProtocol . Capabilities {
5+ /** The debug adapter supports the `moduleSymbols` request. */
6+ supportsModuleSymbolsRequest ?: boolean ;
7+ }
8+
49/** A helper type for mapping event types to their corresponding data type. */
510// prettier-ignore
611interface EventMap {
712 "module" : DebugProtocol . ModuleEvent ;
813 "exited" : DebugProtocol . ExitedEvent ;
9- "initialized " : DebugProtocol . InitializedEvent ;
14+ "capabilities " : DebugProtocol . CapabilitiesEvent ;
1015}
1116
1217/** A type assertion to check if a ProtocolMessage is an event or if it is a specific event. */
@@ -40,7 +45,8 @@ export class DebugSessionTracker
4045 private modulesChanged = new vscode . EventEmitter <
4146 vscode . DebugSession | undefined
4247 > ( ) ;
43- private sessionInitialized = new vscode . EventEmitter < vscode . DebugSession > ( ) ;
48+ private sessionGotCapabilities =
49+ new vscode . EventEmitter < [ vscode . DebugSession , LLDBDapCapabilities ] > ( ) ;
4450 private sessionExited = new vscode . EventEmitter < vscode . DebugSession > ( ) ;
4551
4652 /**
@@ -52,8 +58,9 @@ export class DebugSessionTracker
5258 this . modulesChanged . event ;
5359
5460 /** Fired when a debug session is initialized. */
55- onDidInitializeSession : vscode . Event < vscode . DebugSession > =
56- this . sessionInitialized . event ;
61+ onDidGetSessionCapabilities :
62+ vscode . Event < [ vscode . DebugSession , LLDBDapCapabilities ] > =
63+ this . sessionGotCapabilities . event ;
5764
5865 /** Fired when a debug session is exiting. */
5966 onDidExitSession : vscode . Event < vscode . DebugSession > =
@@ -159,8 +166,8 @@ export class DebugSessionTracker
159166 ) ;
160167
161168 this . sessionExited . fire ( session ) ;
162- } else if ( isEvent ( message , "initialized " ) ) {
163- this . sessionInitialized . fire ( session ) ;
169+ } else if ( isEvent ( message , "capabilities " ) ) {
170+ this . sessionGotCapabilities . fire ( [ session , message . body . capabilities ] ) ;
164171 }
165172 }
166173}
0 commit comments