From 4eee5c6ee5d36dbcc5261268b913e608ff9af8c8 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Wed, 21 Apr 2021 11:03:32 -0700 Subject: [PATCH] testing: fix test wrapper not including ranges and not dealing with sync discovered root --- .vscode/launch.json | 7 +++++++ src/vs/workbench/api/common/extHostTesting.ts | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index b1db49c2549..3189af066ff 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -199,6 +199,13 @@ "name": "Attach to VS Code", "browserAttachLocation": "workspace", "port": 9222, + "trace": true, + "outFiles": [ + "${workspaceFolder}/out/**/*.js" + ], + "resolveSourceMapLocations": [ + "${workspaceFolder}/out/**/*.js" + ], "perScriptSourcemaps": "yes" }, { diff --git a/src/vs/workbench/api/common/extHostTesting.ts b/src/vs/workbench/api/common/extHostTesting.ts index ff7c6e4aae9..7bcecbeac8e 100644 --- a/src/vs/workbench/api/common/extHostTesting.ts +++ b/src/vs/workbench/api/common/extHostTesting.ts @@ -552,7 +552,9 @@ export const createDefaultDocumentTestRoot = async ( TestItemFilteredWrapper.removeFilter(document); }); - return TestItemFilteredWrapper.getWrapperForTestItem(root, document); + const wrapper = TestItemFilteredWrapper.getWrapperForTestItem(root, document); + wrapper.refreshMatch(); + return wrapper; }; /* @@ -623,6 +625,7 @@ export class TestItemFilteredWrapper extends TestItemImpl { this.description = actual.description; this.error = actual.error; this.status = actual.status; + this.range = actual.range; this.resolveHandler = actual.resolveHandler; const wrapperApi = getPrivateApiFor(this); @@ -648,7 +651,7 @@ export class TestItemFilteredWrapper extends TestItemImpl { * if the test itself has a location that matches, or if any of its * children do. */ - private refreshMatch() { + public refreshMatch() { const didMatch = this._cachedMatchesFilter; // The `children` of the wrapper only include the children who match the