Skip to content

Commit

Permalink
invalidate-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matepek committed Sep 11, 2023
1 parent 8137784 commit 28b55e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
}
};

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,
Expand Down Expand Up @@ -272,6 +282,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
removeWorkspaceManager(wf);
}
log.info('Disposing controller');
testResultInvalidator.dispose();
runProfile.dispose();
debugProfile.dispose();
controller.dispose();
Expand Down

0 comments on commit 28b55e6

Please sign in to comment.