MCPcopy Index your code
hub / github.com/microsoft/vscode / findElements

Function findElements

test/automation/src/code.ts:406–421  ·  view source on GitHub ↗
(element: IElement, fn: (element: IElement) => boolean)

Source from the content-addressed store, hash-verified

404}
405
406export function findElements(element: IElement, fn: (element: IElement) => boolean): IElement[] {
407 const result: IElement[] = [];
408 const queue = [element];
409
410 while (queue.length > 0) {
411 const element = queue.shift()!;
412
413 if (fn(element)) {
414 result.push(element);
415 }
416
417 queue.push(...element.children);
418 }
419
420 return result;
421}

Callers 1

toChangeFunction · 0.90

Calls 3

pushMethod · 0.65
fnFunction · 0.50
shiftMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…