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

Method _copyObjectToClipboard

valdi/vscode_debugger/src/adapter/threads.ts:1304–1329  ·  view source on GitHub ↗
(object: Cdp.Runtime.RemoteObject)

Source from the content-addressed store, hash-verified

1302 }
1303
1304 async _copyObjectToClipboard(object: Cdp.Runtime.RemoteObject) {
1305 if (!object.objectId) {
1306 this._dap.with(dap =>
1307 dap.copyRequested({ text: objectPreview.previewRemoteObject(object, 'copy') }),
1308 );
1309 return;
1310 }
1311
1312 try {
1313 const result = await serializeForClipboard({
1314 cdp: this.cdp(),
1315 objectId: object.objectId,
1316 args: [2],
1317 silent: true,
1318 returnByValue: true,
1319 });
1320
1321 this._dap.with(dap => dap.copyRequested({ text: result.value }));
1322 } catch (e) {
1323 // ignored
1324 } finally {
1325 this.cdp()
1326 .Runtime.releaseObject({ objectId: object.objectId })
1327 .catch(() => undefined);
1328 }
1329 }
1330
1331 async _queryObjects(prototype: Cdp.Runtime.RemoteObject) {
1332 const slot = this._claimOutputSlot();

Callers 1

_initializeMethod · 0.95

Calls 4

cdpMethod · 0.95
withMethod · 0.80
copyRequestedMethod · 0.80
releaseObjectMethod · 0.65

Tested by

no test coverage detected