Skip to content

Commit b4accee

Browse files
committed
Rename experimentalTestTracking to dynamicTestTracking and default to true
Rather than just removing the setting, it will remain for (at least) one release like this so that it's possible to opt-out in the case of there being any bugs (that don't warrant a hotfix). Fixes #5668
1 parent b589696 commit b4accee

5 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3337,10 +3337,10 @@
33373337
"markdownDescription": "Whether to enable experimental (possibly unfinished or unstable) refactors on the lightbulb menu. This setting is intended for use by Dart Analysis Server developers or users that want to try out and provide feedback on in-progress refactors.",
33383338
"scope": "window"
33393339
},
3340-
"dart.experimentalTestTracking": {
3340+
"dart.dynamicTestTracking": {
33413341
"type": "boolean",
3342-
"default": false,
3343-
"markdownDescription": "Whether to enable experimental tracking of test locations. This may improve the experience when using packages like `pkg:test_reflective_loader` where tests are only discovered during test runs and not during coding.",
3342+
"default": true,
3343+
"markdownDescription": "Whether to use the new dynamic test tracking. This is a temporary setting that will be removed in an upcoming release.",
33443344
"scope": "window"
33453345
},
33463346
"dart.experimentalDtdHandlers": {

‎src/extension/config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class Config {
183183
get experimentalPropertyEditor(): boolean { return this.getConfig<boolean>("experimentalPropertyEditor", false); }
184184
get experimentalFlutterWidgetPreview(): boolean { return this.getConfig<boolean>("experimentalFlutterWidgetPreview", false); }
185185
get flutterWidgetPreviewLocation(): "beside" | "sidebar" { return this.getConfig<"beside" | "sidebar">("flutterWidgetPreviewLocation", "sidebar"); }
186-
get experimentalTestTracking(): boolean { return this.getConfig<boolean>("experimentalTestTracking", false); }
186+
get dynamicTestTracking(): boolean { return this.getConfig<boolean>("dynamicTestTracking", true); }
187187
get dtdEditorActiveLocationDelay(): number { return this.getConfig<number>("dtdEditorActiveLocationDelay", 200); }
188188
get previewFlutterUiGuides(): boolean { return this.getConfig<boolean>("previewFlutterUiGuides", false); }
189189
get previewFlutterUiGuidesCustomTracking(): boolean { return this.getConfig<boolean>("previewFlutterUiGuidesCustomTracking", false); }

‎src/extension/test/vs_test_controller.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ export class VsCodeTestController implements TestEventListener, IAmDisposable {
356356
// Only update locations of tests that already have locations if they are from the Outline, because
357357
// if they were from results then re-applying the original location might now be inaccurate due to
358358
// changes to the file.
359-
if (config.experimentalTestTracking || !item.range || node.testSource === TestSource.Outline) {
359+
if (config.dynamicTestTracking || !item.range || node.testSource === TestSource.Outline) {
360360
item.range = new vs.Range(
361361
new vs.Position(node.range.start.line, node.range.start.character),
362362
new vs.Position(node.range.end.line, node.range.end.character),

‎src/shared/test/test_model.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export class TestModel {
175175
// TODO: Make private?
176176
public readonly suites = new DocumentCache<SuiteData>();
177177

178-
public constructor(private readonly logger: Logger, private readonly config: { experimentalTestTracking: boolean; showSkippedTests: boolean }, private readonly isPathInsideFlutterProject: (path: string) => boolean) { }
178+
public constructor(private readonly logger: Logger, private readonly config: { dynamicTestTracking: boolean; showSkippedTests: boolean }, private readonly isPathInsideFlutterProject: (path: string) => boolean) { }
179179

180180
public addTestEventListener(listener: TestEventListener) {
181181
this.testEventListeners.push(listener);
@@ -393,7 +393,7 @@ export class TestModel {
393393
const originalRange = testNode.range;
394394
testNode.range = range;
395395

396-
if (!this.config.experimentalTestTracking) {
396+
if (!this.config.dynamicTestTracking) {
397397
// If we're an Outline node being updated, and we have Results children that
398398
// had the same range as us, they should be updated too, so Results nodes do not
399399
// drift away from the location over time.
@@ -461,7 +461,7 @@ export class TestModel {
461461

462462
// If this node is from a result, track its location so we can keep it
463463
// up-to-date as the user edits the file.
464-
if (this.config.experimentalTestTracking && source === TestSource.Result && node.testSource === TestSource.Result && range && nodePath) {
464+
if (this.config.dynamicTestTracking && source === TestSource.Result && node.testSource === TestSource.Result && range && nodePath) {
465465
void this.rangeTracker.trackRangeForUri(
466466
URI.file(suitePath),
467467
range,

‎src/test/dart_debug/dart_test.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,6 @@ test/tree_test.dart [6/8 passed] Failed
578578
}
579579

580580
it("keeps test model updated as documents change", async () => {
581-
await setConfigForTest("dart", "experimentalTestTracking", true);
582581
writeFileSync(fsPath(helloWorldTestEmptyFile), "");
583582
await openFile(helloWorldTestEmptyFile);
584583
await setTestContent(`

0 commit comments

Comments
 (0)