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

Method constructor

valdi/vscode_debugger/src/adapter/debugAdapter.ts:45–93  ·  view source on GitHub ↗
(
    dap: Dap.Api,
    private readonly asyncStackPolicy: IAsyncStackPolicy,
    private readonly launchConfig: AnyLaunchConfiguration,
    private readonly _services: Container,
  )

Source from the content-addressed store, hash-verified

43 private lastBreakpointId = 0;
44
45 constructor(
46 dap: Dap.Api,
47 private readonly asyncStackPolicy: IAsyncStackPolicy,
48 private readonly launchConfig: AnyLaunchConfiguration,
49 private readonly _services: Container,
50 ) {
51 this._configurationDoneDeferred = getDeferred();
52 this.dap = dap;
53 this.dap.on('initialize', params => this._onInitialize(params));
54 this.dap.on('setBreakpoints', params => this._onSetBreakpoints(params));
55 this.dap.on('getBreakpoints', () => this._onGetBreakpoints());
56 this.dap.on('setExceptionBreakpoints', params => this.setExceptionBreakpoints(params));
57 this.dap.on('configurationDone', () => this.configurationDone());
58 this.dap.on('loadedSources', () => this._onLoadedSources());
59 this.dap.on('source', params => this._onSource(params));
60 this.dap.on('threads', () => this._onThreads());
61 this.dap.on('stackTrace', params => this._onStackTrace(params));
62 this.dap.on('variables', params => this._onVariables(params));
63 this.dap.on('setVariable', params => this._onSetVariable(params));
64 this.dap.on('continue', () => this._withThread(thread => thread.resume()));
65 this.dap.on('pause', () => this._withThread(thread => thread.pause()));
66 this.dap.on('next', () => this._withThread(thread => thread.stepOver()));
67 this.dap.on('stepIn', () => this._withThread(thread => thread.stepInto()));
68 this.dap.on('stepOut', () => this._withThread(thread => thread.stepOut()));
69 this.dap.on('restartFrame', params => this._withThread(thread => thread.restartFrame(params)));
70 this.dap.on('scopes', params => this._withThread(thread => thread.scopes(params)));
71 this.dap.on('evaluate', params => this._withThread(thread => thread.evaluate(params)));
72 this.dap.on('completions', params => this._withThread(thread => thread.completions(params)));
73 this.dap.on('exceptionInfo', () => this._withThread(thread => thread.exceptionInfo()));
74 this.dap.on('enableCustomBreakpoints', params => this.enableCustomBreakpoints(params));
75 this.dap.on('toggleSkipFileStatus', params => this._toggleSkipFileStatus(params));
76 this.dap.on('disableCustomBreakpoints', params => this._disableCustomBreakpoints(params));
77 this.dap.on('canPrettyPrintSource', params => this._canPrettyPrintSource(params));
78 this.dap.on('prettyPrintSource', params => this._prettyPrintSource(params));
79 this.dap.on('revealPage', () => this._withThread(thread => thread.revealPage()));
80 this.dap.on('breakpointLocations', params =>
81 this._withThread(async thread => ({
82 breakpoints: await this.breakpointManager.getBreakpointLocations(thread, params),
83 })),
84 );
85
86 this.sourceContainer = _services.get(SourceContainer);
87 this.breakpointManager = _services.get(BreakpointManager);
88
89 const telemetry = _services.get<ITelemetryReporter>(ITelemetryReporter);
90 telemetry.onFlush(() => {
91 telemetry.report('breakpointStats', this.breakpointManager.statisticsForTelemetry());
92 });
93 }
94
95 public async launchBlocker(): Promise<void> {
96 await this._configurationDoneDeferred.promise;

Callers

nothing calls this directly

Calls 15

_onInitializeMethod · 0.95
_onSetBreakpointsMethod · 0.95
_onGetBreakpointsMethod · 0.95
configurationDoneMethod · 0.95
_onLoadedSourcesMethod · 0.95
_onSourceMethod · 0.95
_onThreadsMethod · 0.95
_onStackTraceMethod · 0.95
_onVariablesMethod · 0.95
_onSetVariableMethod · 0.95
_withThreadMethod · 0.95

Tested by

no test coverage detected