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

Method _onSource

valdi/vscode_debugger/src/adapter/debugAdapter.ts:189–204  ·  view source on GitHub ↗
(params: Dap.SourceParams)

Source from the content-addressed store, hash-verified

187 }
188
189 async _onSource(params: Dap.SourceParams): Promise<Dap.SourceResult | Dap.Error> {
190 if (!params.source) {
191 params.source = { sourceReference: params.sourceReference };
192 }
193
194 params.source.path = urlUtils.platformPathToPreferredCase(params.source.path);
195 const source = this.sourceContainer.source(params.source);
196 if (!source)
197 return errors.createSilentError(localize('error.sourceNotFound', 'Source not found'));
198 const content = await source.content();
199 if (content === undefined)
200 return errors.createSilentError(
201 localize('error.sourceContentDidFail', 'Unable to retrieve source content'),
202 );
203 return { content, mimeType: source.mimeType() };
204 }
205
206 async _onThreads(): Promise<Dap.ThreadsResult | Dap.Error> {
207 const threads: Dap.Thread[] = [];

Callers 1

constructorMethod · 0.95

Calls 3

mimeTypeMethod · 0.80
sourceMethod · 0.65
contentMethod · 0.65

Tested by

no test coverage detected