MCPcopy Create free account
hub / github.com/Snapchat/Valdi / constructor

Method constructor

valdi/vscode_debugger/src/binder.ts:62–146  ·  view source on GitHub ↗
(
    delegate: IBinderDelegate,
    connection: DapConnection,
    private readonly _rootServices: Container,
    targetOrigin: ITargetOrigin,
  )

Source from the content-addressed store, hash-verified

60 private _launchers?: ReadonlySet<ILauncher>;
61
62 constructor(
63 delegate: IBinderDelegate,
64 connection: DapConnection,
65 private readonly _rootServices: Container,
66 targetOrigin: ITargetOrigin,
67 ) {
68 this._delegate = delegate;
69 this._dap = connection.dap();
70 this._targetOrigin = targetOrigin;
71 this._disposables = [
72 this._onTargetListChangedEmitter,
73 installUnhandledErrorReporter(
74 _rootServices.get(ILogger),
75 _rootServices.get(ITelemetryReporter),
76 ),
77 ];
78
79 connection.attachTelemetry(_rootServices.get(ITelemetryReporter));
80
81 this._dap.then(dap => {
82 let lastBreakpointId = 0;
83 let selfProfile: SelfProfile | undefined;
84
85 dap.on('initialize', async clientCapabilities => {
86 this._rootServices.bind(IInitializeParams).toConstantValue(clientCapabilities);
87 const capabilities = DebugAdapter.capabilities();
88 if (clientCapabilities.clientID === 'vscode') {
89 filterErrorsReportedToTelemetry();
90 }
91
92 setTimeout(() => {
93 dap.initialized({});
94 }, 0);
95 return capabilities;
96 });
97 dap.on('setExceptionBreakpoints', async () => ({}));
98 dap.on('setBreakpoints', async params => {
99 return {
100 breakpoints:
101 params.breakpoints?.map(() => ({
102 id: ++lastBreakpointId,
103 verified: false,
104 message: localize('breakpoint.provisionalBreakpoint', `Unbound breakpoint`),
105 })) ?? [],
106 }; // TODO: Put a useful message here
107 });
108 dap.on('configurationDone', async () => ({}));
109 dap.on('threads', async () => ({ threads: [] }));
110 dap.on('loadedSources', async () => ({ sources: [] }));
111 dap.on('breakpointLocations', () => Promise.resolve({ breakpoints: [] }));
112 dap.on('attach', params =>
113 this._boot(applyDefaults(params as AnyResolvingConfiguration), dap),
114 );
115 dap.on('launch', params =>
116 this._boot(applyDefaults(params as AnyResolvingConfiguration), dap),
117 );
118 dap.on('terminate', async () => {
119 await this._disconnect();

Callers

nothing calls this directly

Calls 15

_bootMethod · 0.95
_disconnectMethod · 0.95
_restartMethod · 0.95
applyDefaultsFunction · 0.90
dapMethod · 0.80
attachTelemetryMethod · 0.80
getMethod · 0.65
thenMethod · 0.65
onMethod · 0.65
bindMethod · 0.65

Tested by

no test coverage detected