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

Method _queryObjects

valdi/vscode_debugger/src/adapter/threads.ts:1331–1364  ·  view source on GitHub ↗
(prototype: Cdp.Runtime.RemoteObject)

Source from the content-addressed store, hash-verified

1329 }
1330
1331 async _queryObjects(prototype: Cdp.Runtime.RemoteObject) {
1332 const slot = this._claimOutputSlot();
1333 if (!prototype.objectId) return slot();
1334 const response = await this.cdp().Runtime.queryObjects({
1335 prototypeObjectId: prototype.objectId,
1336 objectGroup: 'console',
1337 });
1338 await this.cdp().Runtime.releaseObject({ objectId: prototype.objectId });
1339 if (!response) return slot();
1340
1341 let withPreview: Cdp.Runtime.RemoteObject;
1342 try {
1343 withPreview = await previewThis({
1344 cdp: this.cdp(),
1345 args: [],
1346 objectId: response.objects.objectId,
1347 objectGroup: 'console',
1348 generatePreview: true,
1349 });
1350 } catch (e) {
1351 return slot();
1352 }
1353
1354 const text =
1355 '\x1b[32mobjects: ' + objectPreview.previewRemoteObject(withPreview, 'repl') + '\x1b[0m';
1356 const variablesReference =
1357 (await this.replVariables.createVariableForOutput(text, [withPreview])) || 0;
1358 const output = {
1359 category: 'stdout' as 'stdout',
1360 output: '',
1361 variablesReference,
1362 };
1363 slot(output);
1364 }
1365
1366 private async _onThreadPaused(details: IPausedDetails) {
1367 this._expectedPauseReason = undefined;

Callers 1

_initializeMethod · 0.95

Calls 5

_claimOutputSlotMethod · 0.95
cdpMethod · 0.95
queryObjectsMethod · 0.80
releaseObjectMethod · 0.65

Tested by

no test coverage detected