MCPcopy
hub / github.com/microsoft/vscode-js-debug / constructor

Method constructor

src/binder.ts:94–181  ·  view source on GitHub ↗
(
    private readonly _delegate: IBinderDelegate,
    connection: DapConnection,
    private readonly _rootServices: Container,
    targetOrigin: ITargetOrigin,
  )

Source from the content-addressed store, hash-verified

92 private _root = new TreeNode(undefined);
93
94 constructor(
95 private readonly _delegate: IBinderDelegate,
96 connection: DapConnection,
97 private readonly _rootServices: Container,
98 targetOrigin: ITargetOrigin,
99 ) {
100 this._dap = connection.dap();
101 this._targetOrigin = targetOrigin;
102 this._disposables.callback(() => disposeContainer(_rootServices));
103 this._disposables.push(
104 installUnhandledErrorReporter(
105 _rootServices.get(ILogger),
106 _rootServices.get(ITelemetryReporter),
107 _rootServices.get(IsVSCode),
108 ),
109 );
110
111 connection.attachTelemetry(_rootServices.get(ITelemetryReporter));
112
113 const dap = this._dap;
114 let lastBreakpointId = 0;
115 let selfProfile: SelfProfile | undefined;
116
117 dap.on('initialize', async clientCapabilities => {
118 this._rootServices.bind(IInitializeParams).toConstantValue(clientCapabilities);
119 const capabilities = DebugAdapter.capabilities();
120 if (clientCapabilities.clientID === 'vscode') {
121 filterErrorsReportedToTelemetry();
122 }
123
124 setTimeout(() => dap.initialized({}), 0);
125 return capabilities;
126 });
127 dap.on('setExceptionBreakpoints', async () => ({}));
128 dap.on('setBreakpoints', async params => {
129 if (params.breakpoints?.length) {
130 _rootServices.get(DiagnosticToolSuggester).notifyHadBreakpoint();
131 }
132
133 return {
134 breakpoints: params.breakpoints?.map(() => ({
135 id: ++lastBreakpointId,
136 verified: false,
137 message: l10n.t('Unbound breakpoint'),
138 })) ?? [],
139 };
140 });
141 dap.on('configurationDone', async () => ({}));
142 dap.on('threads', async () => ({ threads: [] }));
143 dap.on('loadedSources', async () => ({ sources: [] }));
144 dap.on('breakpointLocations', () => Promise.resolve({ breakpoints: [] }));
145 dap.on('attach', async params => {
146 await this.boot(params as AnyResolvingConfiguration, dap);
147 return {};
148 });
149 dap.on('launch', async params => {
150 await this.boot(params as AnyResolvingConfiguration, dap);
151 return {};

Callers

nothing calls this directly

Calls 15

bootMethod · 0.95
_terminateRootMethod · 0.95
_disconnectRootMethod · 0.95
_restartMethod · 0.95
disposeContainerFunction · 0.90
dapMethod · 0.80
callbackMethod · 0.80
attachTelemetryMethod · 0.80
bindMethod · 0.80
notifyHadBreakpointMethod · 0.80

Tested by

no test coverage detected