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();