MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / sourceRequest

Function sourceRequest

src/debug/dart_debug_impl.ts:625–639  ·  view source on GitHub ↗
(response: DebugProtocol.SourceResponse, args: DebugProtocol.SourceArguments)

Source from the content-addressed store, hash-verified

623 }
624
625 protected sourceRequest(response: DebugProtocol.SourceResponse, args: DebugProtocol.SourceArguments): void {
626 const sourceReference = args.sourceReference;
627 const data = this.threadManager.getStoredData(sourceReference);
628 const scriptRef: VMScriptRef = data.data as VMScriptRef;
629
630 data.thread.getScript(scriptRef).then((script: VMScript) => {
631 if (script.source) {
632 response.body = { content: script.source, mimeType: "text/x-dart" };
633 } else {
634 response.success = false;
635 response.message = "<source not available>";
636 }
637 this.sendResponse(response);
638 }).catch((error) => this.errorResponse(response, `${error}`));
639 }
640
641 protected threadsRequest(response: DebugProtocol.ThreadsResponse): void {
642 response.body = { threads: this.threadManager.getThreads() };

Callers

nothing calls this directly

Calls 3

getStoredDataMethod · 0.80
getScriptMethod · 0.80
sendResponseMethod · 0.80

Tested by

no test coverage detected