@@ -55,7 +55,7 @@ ada: Clean current project - gprclean -P ${projectPath}
55
55
ada: Build current project - gprbuild -P ${ projectPath } -cargs:ada -gnatef
56
56
ada: Check current file - gprbuild -q -f -c -u -gnatc -P ${ projectPath } \${fileBasename} -cargs:ada -gnatef
57
57
ada: Analyze the project with GNAT SAS - gnatsas analyze -P ${ projectPath }
58
- ada: Analyze the current file with GNAT SAS - gnatsas analyze -P ${ projectPath } \${fileBasename}
58
+ ada: Analyze the current file with GNAT SAS - gnatsas analyze -P ${ projectPath } --file= \${fileBasename}
59
59
ada: Create a report after a GNAT SAS analysis - gnatsas report sarif -P ${ projectPath }
60
60
ada: Generate documentation from the project - gnatdoc -P ${ projectPath }
61
61
ada: Create/update test skeletons for the project - gnattest -P ${ projectPath }
@@ -212,21 +212,21 @@ suite('Task Execution', function () {
212
212
allProvidedTasks . push ( ...( await createAdaTaskProvider ( ) . provideTasks ( ) ) ) ;
213
213
} ) ;
214
214
215
- declTaskTest ( 'ada: Build current project' , testedTaskLabels ) ;
216
- declTaskTest ( 'ada: Run main - src/main1.adb' , testedTaskLabels ) ;
217
- declTaskTest ( 'ada: Run main - src/test.adb' , testedTaskLabels ) ;
218
- declTaskTest ( 'ada: Check current file' , testedTaskLabels , openSrcFile ) ;
219
- declTaskTest ( 'ada: Clean current project' , testedTaskLabels ) ;
220
- declTaskTest ( 'ada: Build main - src/main1.adb' , testedTaskLabels ) ;
221
- declTaskTest ( 'ada: Build main - src/test.adb' , testedTaskLabels ) ;
222
- declTaskTest ( 'ada: Build and run main - src/main1.adb' , testedTaskLabels ) ;
223
- declTaskTest ( 'ada: Build and run main - src/test.adb' , testedTaskLabels ) ;
224
- declTaskTest ( 'ada: Analyze the project with GNAT SAS' , testedTaskLabels ) ;
225
- declTaskTest ( 'ada: Create a report after a GNAT SAS analysis' , testedTaskLabels ) ;
226
- declTaskTest ( 'ada: Analyze the project with GNAT SAS and produce a report' , testedTaskLabels ) ;
227
- declTaskTest ( 'ada: Analyze the current file with GNAT SAS' , testedTaskLabels , openSrcFile ) ;
228
- declTaskTest ( 'ada: Generate documentation from the project' , testedTaskLabels ) ;
229
- declTaskTest ( 'ada: Create/update test skeletons for the project' , testedTaskLabels ) ;
215
+ declTaskTest ( 'ada: Build current project' ) ;
216
+ declTaskTest ( 'ada: Run main - src/main1.adb' ) ;
217
+ declTaskTest ( 'ada: Run main - src/test.adb' ) ;
218
+ declTaskTest ( 'ada: Check current file' , openSrcFile ) ;
219
+ declTaskTest ( 'ada: Clean current project' ) ;
220
+ declTaskTest ( 'ada: Build main - src/main1.adb' ) ;
221
+ declTaskTest ( 'ada: Build main - src/test.adb' ) ;
222
+ declTaskTest ( 'ada: Build and run main - src/main1.adb' ) ;
223
+ declTaskTest ( 'ada: Build and run main - src/test.adb' ) ;
224
+ declTaskTest ( 'ada: Analyze the project with GNAT SAS' ) ;
225
+ declTaskTest ( 'ada: Create a report after a GNAT SAS analysis' ) ;
226
+ declTaskTest ( 'ada: Analyze the project with GNAT SAS and produce a report' ) ;
227
+ declTaskTest ( 'ada: Analyze the current file with GNAT SAS' , openSrcFile ) ;
228
+ declTaskTest ( 'ada: Generate documentation from the project' ) ;
229
+ declTaskTest ( 'ada: Create/update test skeletons for the project' ) ;
230
230
231
231
/**
232
232
* Check that the 'buildAndRunMain' task works fine with projects that
@@ -249,8 +249,8 @@ suite('Task Execution', function () {
249
249
await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ;
250
250
await testTask (
251
251
'Build and run main - src/main1.adb' ,
252
- allProvidedTasks ,
253
- testedTaskLabels
252
+ testedTaskLabels ,
253
+ allProvidedTasks
254
254
) ;
255
255
} finally {
256
256
// Reset the 'ada.projectFile' setting. If the previous value was
@@ -314,20 +314,23 @@ suite('Task Execution', function () {
314
314
* has to be defined in the same module as the testsuite in order for the
315
315
* testing GUI to detect the tests in VS Code.
316
316
*/
317
- function declTaskTest (
318
- taskName : string ,
319
- testedTasks : Set < string > ,
320
- prolog ?: ( ) => void | Promise < void >
321
- ) : Mocha . Test {
317
+ function declTaskTest ( taskName : string , prolog ?: ( ) => void | Promise < void > ) : Mocha . Test {
322
318
return test ( taskName , async function ( ) {
323
319
if ( prolog ) {
324
320
await prolog ( ) ;
325
321
}
326
322
327
- await testTask ( taskName , allProvidedTasks , testedTasks ) ;
323
+ /**
324
+ * If there was a prolog, don't use the static task list computed at
325
+ * the beginning. Tasks are sensitive to the current cursor location
326
+ * so we recompute available tasks instead of using the static task
327
+ * list.
328
+ */
329
+ await testTask ( taskName , testedTaskLabels , prolog ? undefined : allProvidedTasks ) ;
328
330
} ) ;
329
331
}
330
332
} ) ;
333
+
331
334
async function openSrcFile ( ) {
332
335
assert ( vscode . workspace . workspaceFolders ) ;
333
336
const testAdbUri = vscode . Uri . joinPath (
0 commit comments