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

Function findElement

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

Source from the content-addressed store, hash-verified

388}
389
390export function findElement(element: IElement, fn: (element: IElement) => boolean): IElement | null {
391 const queue = [element];
392
393 while (queue.length > 0) {
394 const element = queue.shift()!;
395
396 if (fn(element)) {
397 return element;
398 }
399
400 queue.push(...element.children);
401 }
402
403 return null;
404}
405
406export function findElements(element: IElement, fn: (element: IElement) => boolean): IElement[] {
407 const result: IElement[] = [];

Callers 2

toChangeFunction · 0.90
toStackFrameFunction · 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…