Skip to content

Commit a63a11d

Browse files
committed
Rework the loading of GNATtest tests into VS Code
* Make test loading lazy for efficiency on large test bases * Listen to changes of gnattest.xml and refresh the test tree
1 parent bbe16e4 commit a63a11d

File tree

4 files changed

+280
-151
lines changed

4 files changed

+280
-151
lines changed

integration/vscode/ada/src/ExtensionState.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { initializeTesting } from './gnattest';
88
import { GprTaskProvider } from './gprTaskProvider';
99
import { TERMINAL_ENV_SETTING_NAME } from './helpers';
1010
import { registerTaskProviders } from './taskProviders';
11+
import { initializeTesting } from './gnattest';
1112

1213
/**
1314
* This class encapsulates all state that should be maintained throughout the
@@ -32,6 +33,8 @@ export class ExtensionState {
3233
private registeredTaskProviders: Disposable[];
3334

3435
public readonly codelensProvider = new AdaCodeLensProvider();
36+
public readonly testController: vscode.TestController;
37+
public readonly testData: Map<vscode.TestItem, object> = new Map();
3538

3639
/**
3740
* The following fields are caches for ALS requests
@@ -68,6 +71,7 @@ export class ExtensionState {
6871
const result = initializeDebugging(this.context);
6972
this.initialDebugConfigProvider = result.providerInitial;
7073
this.dynamicDebugConfigProvider = result.providerDynamic;
74+
this.testController = initializeTesting(context);
7175
}
7276

7377
public start = async () => {

integration/vscode/ada/src/extension.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { ExtensionState } from './ExtensionState';
2626
import { ALSClientFeatures } from './alsClientFeatures';
2727
import { alsCommandExecutor } from './alsExecuteCommand';
2828
import { registerCommands } from './commands';
29-
import { initializeTestView } from './gnattest';
3029
import {
3130
TERMINAL_ENV_SETTING_NAME,
3231
assertSupportedEnvironments,
@@ -161,8 +160,6 @@ async function activateExtension(context: vscode.ExtensionContext) {
161160

162161
await vscode.commands.executeCommand('setContext', ADA_CONTEXT, true);
163162

164-
await initializeTestView(context, adaExtState);
165-
166163
/**
167164
* This can display a dialog to the User so don't wait on the result.
168165
*/

0 commit comments

Comments
 (0)