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

Method setupRangeTracking

src/shared/test/test_model.ts:601–627  ·  view source on GitHub ↗

* If this node is from a result, track its location so we can keep it up-to-date as the user edits the file.

(node: GroupNode | TestNode, source: TestSource, suitePath: string, range: Range | undefined, nodePath: string | undefined)

Source from the content-addressed store, hash-verified

599 * If this node is from a result, track its location so we can keep it up-to-date as the user edits the file.
600 */
601 private setupRangeTracking(node: GroupNode | TestNode, source: TestSource, suitePath: string, range: Range | undefined, nodePath: string | undefined): void {
602 // Dispose any previous tracker, because we may create a new one below if this new
603 // location needs tracking.
604 node.dispose();
605
606 if (!range || !nodePath || !this.config.dynamicTestTracking)
607 return;
608
609 if (source !== TestSource.Result || node.testSource !== TestSource.Result)
610 return;
611
612 void this.rangeTracker.trackRangeForUri(
613 URI.file(suitePath),
614 range,
615 (newRange) => {
616 if (newRange) {
617 node.range = newRange;
618 this.updateNode({ node });
619 } else {
620 this.removeNode(node);
621 }
622 },
623 ).then(
624 (tracker) => node.rangeTracker = tracker,
625 (e) => this.logger.error(e),
626 );
627 }
628
629 public testDone(dartCodeDebugSessionID: string, suitePath: string, testID: number, result: "skipped" | "success" | "failure" | "error" | undefined, endTime: number | undefined): void {
630 const suite = this.suites.getForPath(suitePath)!;

Callers 2

groupDiscoveredMethod · 0.95
testDiscoveredMethod · 0.95

Calls 5

updateNodeMethod · 0.95
removeNodeMethod · 0.95
trackRangeForUriMethod · 0.80
disposeMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected