Skip to content

Commit 8bdb2a5

Browse files
committed
Merge branch 'topic/e3-testsuite' into 'master'
Reload e3-testsuite in VS Code upon config change See merge request eng/ide/ada_language_server!2146
2 parents 6c7d1a8 + 5bbdbd7 commit 8bdb2a5

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
section below it for the last release. -->
55
## \<next>
66

7+
* Reload `e3-testsuite` tests automatically after configuration changes
8+
79
## 2026.0.202510141
810

911
* New [Code Visualizer](https://github.com/AdaCore/ada_language_server/blob/master/doc/ShowGraphDoc.md) displaying code information as interactive graphs (e.g. `Types: Show Type Hierarchy Graph` command), for any language with LSP support in VS Code (e.g. Ada, Python, TypeScript).

integration/vscode/ada/src/e3Testsuite.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,16 @@ export function activateE3TestsuiteIntegration(context: vscode.ExtensionContext)
8282

8383
const testData: Map<vscode.TestItem, TestInfo> = new Map();
8484

85-
const ts: Testsuite = getTestsuite();
8685
let rootItem: vscode.TestItem;
8786

8887
controller.refreshHandler = async function () {
8988
controller.items.replace([]);
9089
testData.clear();
9190

91+
const ts: Testsuite = getTestsuite();
92+
logger.info(`Loading e3-testsuite: ${JSON.stringify(ts)}`);
9293
if (!existsSync(ts.uri.fsPath)) {
94+
logger.info(`${ts.uri.fsPath} doesn't exist, doing nothing.`);
9395
return;
9496
}
9597

@@ -182,6 +184,7 @@ export function activateE3TestsuiteIntegration(context: vscode.ExtensionContext)
182184
const enableEventSystem: boolean =
183185
vscode.workspace.getConfiguration('e3-testsuite').get('enableEventSystem') ?? true;
184186

187+
const ts: Testsuite = getTestsuite();
185188
const cmd = [ts.python, ts.uri.fsPath, '--failure-exit-code=0'];
186189

187190
const remainingSet: Set<vscode.TestItem> = new Set();
@@ -534,7 +537,15 @@ export function activateE3TestsuiteIntegration(context: vscode.ExtensionContext)
534537
reportResult(run, result.status, targetItem, messages);
535538
}
536539

537-
if (existsSync(ts.uri.fsPath)) {
540+
context.subscriptions.push(
541+
vscode.workspace.onDidChangeConfiguration((e) => {
542+
if (e.affectsConfiguration('e3-testsuite')) {
543+
loadTests();
544+
}
545+
}),
546+
);
547+
548+
function loadTests() {
538549
void vscode.window.withProgress(
539550
{
540551
location: vscode.ProgressLocation.Notification,
@@ -547,6 +558,8 @@ export function activateE3TestsuiteIntegration(context: vscode.ExtensionContext)
547558
},
548559
);
549560
}
561+
562+
loadTests();
550563
}
551564

552565
function getRootItemId(ts: Testsuite): string {

0 commit comments

Comments
 (0)