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

Method completions

valdi/vscode_debugger/src/adapter/stackTrace.ts:342–363  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

340 }
341
342 async completions(): Promise<Dap.CompletionItem[]> {
343 if (!this._scope) return [];
344 const variableStore = this._thread.pausedVariables();
345 if (!variableStore) {
346 return [];
347 }
348
349 const promises: Promise<Dap.CompletionItem[]>[] = [];
350 for (let scopeNumber = 0; scopeNumber < this._scope.chain.length; scopeNumber++) {
351 promises.push(
352 this._scopeVariable(scopeNumber, this._scope).then(async scopeVariable => {
353 if (!scopeVariable.variablesReference) return [];
354 const variables = await variableStore.getVariables({
355 variablesReference: scopeVariable.variablesReference,
356 });
357 return variables.map(variable => ({ label: variable.name, type: 'property' }));
358 }),
359 );
360 }
361 const completions = await Promise.all(promises);
362 return ([] as Dap.CompletionItem[]).concat(...completions);
363 }
364}

Callers

nothing calls this directly

Calls 8

_scopeVariableMethod · 0.95
pausedVariablesMethod · 0.80
getVariablesMethod · 0.80
thenMethod · 0.65
allMethod · 0.65
pushMethod · 0.45
mapMethod · 0.45
concatMethod · 0.45

Tested by

no test coverage detected