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

Method _onSource

src/adapter/debugAdapter.ts:407–428  ·  view source on GitHub ↗
(params: Dap.SourceParams)

Source from the content-addressed store, hash-verified

405 }
406
407 async _onSource(params: Dap.SourceParams): Promise<Dap.SourceResult | Dap.Error> {
408 if (!params.source) {
409 params.source = { sourceReference: params.sourceReference };
410 }
411
412 params.source.path = urlUtils.platformPathToPreferredCase(params.source.path);
413 const source = this.sourceContainer.source(params.source);
414 if (!source) {
415 return errors.createSilentError(l10n.t('Source not found'));
416 }
417
418 const content = await source.content();
419 if (content === undefined) {
420 if (source instanceof SourceFromMap) {
421 this.dap.suggestDisableSourcemap({ source: params.source });
422 }
423
424 return errors.createSilentError(l10n.t('Unable to retrieve source content'));
425 }
426
427 return { content, mimeType: source.getSuggestedMimeType };
428 }
429
430 async _onThreads(): Promise<Dap.ThreadsResult | Dap.Error> {
431 const threads: Dap.Thread[] = [];

Callers 1

constructorMethod · 0.95

Calls 3

contentMethod · 0.80
sourceMethod · 0.65

Tested by

no test coverage detected