@@ -55,7 +55,7 @@ ada: Clean current project - gprclean -P ${projectPath}
5555ada: Build current project - gprbuild -P ${ projectPath } -cargs:ada -gnatef
5656ada: Check current file - gprbuild -q -f -c -u -gnatc -P ${ projectPath } \${fileBasename} -cargs:ada -gnatef
5757ada: 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}
5959ada: Create a report after a GNAT SAS analysis - gnatsas report sarif -P ${ projectPath }
6060ada: Generate documentation from the project - gnatdoc -P ${ projectPath }
6161ada: Create/update test skeletons for the project - gnattest -P ${ projectPath }
@@ -212,21 +212,21 @@ suite('Task Execution', function () {
212212 allProvidedTasks . push ( ...( await createAdaTaskProvider ( ) . provideTasks ( ) ) ) ;
213213 } ) ;
214214
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' ) ;
230230
231231 /**
232232 * Check that the 'buildAndRunMain' task works fine with projects that
@@ -249,8 +249,8 @@ suite('Task Execution', function () {
249249 await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ;
250250 await testTask (
251251 'Build and run main - src/main1.adb' ,
252- allProvidedTasks ,
253- testedTaskLabels
252+ testedTaskLabels ,
253+ allProvidedTasks
254254 ) ;
255255 } finally {
256256 // Reset the 'ada.projectFile' setting. If the previous value was
@@ -314,20 +314,23 @@ suite('Task Execution', function () {
314314 * has to be defined in the same module as the testsuite in order for the
315315 * testing GUI to detect the tests in VS Code.
316316 */
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 {
322318 return test ( taskName , async function ( ) {
323319 if ( prolog ) {
324320 await prolog ( ) ;
325321 }
326322
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 ) ;
328330 } ) ;
329331 }
330332} ) ;
333+
331334async function openSrcFile ( ) {
332335 assert ( vscode . workspace . workspaceFolders ) ;
333336 const testAdbUri = vscode . Uri . joinPath (
0 commit comments