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

Function getVariablesTree

src/test/debug_helpers.ts:232–246  ·  view source on GitHub ↗
(dc: DartDebugClient, variablesReference: number)

Source from the content-addressed store, hash-verified

230}
231
232export async function getVariablesTree(dc: DartDebugClient, variablesReference: number): Promise<string[]> {
233 let outputLines: string[] = [];
234 for (const variable of await dc.getVariables(variablesReference)) {
235 // Ignore types that recurse indefinitely, or we just don't want to check
236 // in tests.
237 if (variable.name === "runtimeType" || variable.name === "hashCode")
238 continue;
239 outputLines.push(`${variable.name}=${variable.value}`);
240 if (variable.variablesReference) {
241 const childLines = await getVariablesTree(dc, variable.variablesReference);
242 outputLines = outputLines.concat(childLines.map((l) => ` ${l}`));
243 }
244 }
245 return outputLines;
246}
247
248export function spawnDartProcessPaused(program: Uri, cwd: Uri, ...vmArgs: string[]): DartProcess {
249 const programPath = fsPath(program);

Callers 1

dart_cli.test.tsFile · 0.90

Calls 1

getVariablesMethod · 0.80

Tested by

no test coverage detected