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

Method constructor

src/test/test.ts:344–391  ·  view source on GitHub ↗
(goldenText: GoldenText, private _testTitlePath: string)

Source from the content-addressed store, hash-verified

342 public readonly logger: ILogger;
343
344 constructor(goldenText: GoldenText, private _testTitlePath: string) {
345 this._args = ['--headless'];
346 this.log = goldenText.log.bind(goldenText);
347 this.assertLog = goldenText.assertLog.bind(goldenText);
348 this._workspaceRoot = utils.platformPathToPreferredCase(testWorkspace);
349 this._webRoot = path.join(this._workspaceRoot, 'web');
350
351 const storagePath = path.join(__dirname, '..', '..');
352 // todo: make a more proper mock here
353 const workspaceState = new Map<string, unknown>();
354 const services = createTopLevelSessionContainer(
355 createGlobalContainer({
356 storagePath,
357 isVsCode: true,
358 context: upcastPartial<ExtensionContext>({
359 workspaceState: {
360 keys: () => [],
361 get<T>(key: string, defaultValue?: T) {
362 return workspaceState.get(key) ?? defaultValue;
363 },
364 update(key: string, value: unknown) {
365 workspaceState.set(key, value);
366 return Promise.resolve();
367 },
368 },
369 }),
370 }),
371 );
372
373 this.logger = services.get(ILogger);
374 this._root = new Session(this.logger);
375 const dap = this._root.adapterConnection.dap();
376 dap.on('initialize', async () => {
377 dap.initialized({});
378 return DebugAdapter.capabilities();
379 });
380 dap.on('configurationDone', async () => {
381 return {};
382 });
383
384 this.binder = new Binder(this, this._root.adapterConnection, services, new TargetOrigin('0'));
385
386 this.initialize = this._root._init();
387
388 this._launchCallback = () => {};
389 this._workerCallback = () => {};
390 this._worker = new Promise(f => (this._workerCallback = f));
391 }
392
393 public async acquireDap(target: ITarget): Promise<DapConnection> {
394 const p = target.type() === 'page'

Callers

nothing calls this directly

Calls 10

createGlobalContainerFunction · 0.90
upcastPartialFunction · 0.90
bindMethod · 0.80
dapMethod · 0.80
getMethod · 0.65
onMethod · 0.65
initializedMethod · 0.65
capabilitiesMethod · 0.65
_initMethod · 0.65

Tested by

no test coverage detected