From 28b55e6b9c709fb753e366741c9be5080b753904 Mon Sep 17 00:00:00 2001 From: Mate Pek Date: Mon, 11 Sep 2023 13:05:35 +0700 Subject: [PATCH] invalidate-tests --- CHANGELOG.md | 4 ++++ src/main.ts | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 417ed1f1..c1030982 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [4.6.0] + +Implemented new vscode veature: invalidate result. + ## [4.5.2] - 2023-08-25 _doctest_ improvements diff --git a/src/main.ts b/src/main.ts index d9206277..f166fcf8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -161,6 +161,16 @@ export async function activate(context: vscode.ExtensionContext): Promise } }; + const testResultInvalidator = executableChangedEmitter.event(executables => { + const changedItems: vscode.TestItem[] = []; + for (const e of executables) { + const ei = e.getExecTestItem(); + if (ei) changedItems.push(ei); + else for (const t of e.getTests()) changedItems.push(t.item); + } + controller.invalidateTestResults(changedItems); + }); + const runProfile = controller.createRunProfile( 'Run Test', vscode.TestRunProfileKind.Run, @@ -272,6 +282,7 @@ export async function activate(context: vscode.ExtensionContext): Promise removeWorkspaceManager(wf); } log.info('Disposing controller'); + testResultInvalidator.dispose(); runProfile.dispose(); debugProfile.dispose(); controller.dispose();