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

Function findProjectNode

src/test/helpers.ts:1432–1446  ·  view source on GitHub ↗
(projectPath: string)

Source from the content-addressed store, hash-verified

1430}
1431
1432export function findProjectNode(projectPath: string): vs.TestItem {
1433 const projectID = `PROJECT:${projectPath}`;
1434 const workspaceFolder = vs.workspace.getWorkspaceFolder(vs.Uri.file(projectPath));
1435 const workspaceFolderPath = workspaceFolder ? fsPath(workspaceFolder.uri) : undefined;
1436 const workspaceFolderID = workspaceFolderPath ? `WF:${workspaceFolderPath}` : undefined;
1437
1438 const controller = privateApi.testController!;
1439 const node = controller.controller.items.get(projectID)
1440 ?? (workspaceFolderID ? controller.controller.items.get(workspaceFolderID)?.children.get(projectID) : undefined);
1441
1442 if (!node)
1443 throw new Error(`Could not find project node for ${projectPath}:\n ${workspaceFolderID}\n ${projectID}`);
1444
1445 return node;
1446}
1447
1448export function makeTestTextTree({ items, uriFilter, buffer = [], indent = 0, onlyFailures, onlyActive, sortByLabel }: { items?: vs.TestItemCollection, uriFilter?: vs.Uri, buffer?: string[]; indent?: number, onlyFailures?: boolean, onlyActive?: boolean, sortByLabel?: boolean } = {}): string[] {
1449 const controller = privateApi.testController!;

Callers 2

dart_test.test.tsFile · 0.90

Calls 2

fsPathFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected