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

Method toDap

src/adapter/variableStore.ts:893–911  ·  view source on GitHub ↗
(
    previewContext: PreviewContextType,
    valueFormat?: Dap.ValueFormat,
  )

Source from the content-addressed store, hash-verified

891 }
892
893 public override async toDap(
894 previewContext: PreviewContextType,
895 valueFormat?: Dap.ValueFormat,
896 ): Promise<Dap.Variable> {
897 const [parentDap, value] = await Promise.all([
898 await super.toDap(previewContext, valueFormat),
899 await this.getValueRepresentation(previewContext),
900 ]);
901
902 return {
903 ...parentDap,
904 type: this.remoteObject.className || this.remoteObject.subtype || this.remoteObject.type,
905 variablesReference: this.id,
906 memoryReference: memoryReadableTypes.has(this.remoteObject.subtype)
907 ? String(this.id)
908 : undefined,
909 value,
910 };
911 }
912
913 private async getValueRepresentation(previewContext: PreviewContextType) {
914 if (typeof this.customStringRepr === 'string') {

Callers

nothing calls this directly

Calls 4

allMethod · 0.80
toDapMethod · 0.65
hasMethod · 0.65

Tested by

no test coverage detected