Skip to content

Commit c129aaf

Browse files
committed
Fix a bug in task generation
1 parent 27dd425 commit c129aaf

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

integration/vscode/ada/src/taskProviders.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -412,15 +412,15 @@ export class ConfigurableTaskProvider implements vscode.TaskProvider {
412412
this.tasks = undefined;
413413
break;
414414
}
415-
const def: CustomTaskDefinition = {
416-
type: this.taskType,
417-
configuration: {
418-
kind: 'buildMain',
419-
projectFile: await computeProject(),
420-
main: main.mainRelPath(),
421-
},
422-
};
423415
{
416+
const def: CustomTaskDefinition = {
417+
type: this.taskType,
418+
configuration: {
419+
kind: 'buildMain',
420+
projectFile: await computeProject(),
421+
main: main.mainRelPath(),
422+
},
423+
};
424424
const name = `${allTaskProperties['buildMain'].title}${basename(
425425
main.mainRelPath()
426426
)}`;
@@ -438,7 +438,14 @@ export class ConfigurableTaskProvider implements vscode.TaskProvider {
438438
}
439439

440440
{
441-
def.configuration.kind = 'buildAndRunMain';
441+
const def: CustomTaskDefinition = {
442+
type: this.taskType,
443+
configuration: {
444+
kind: 'buildAndRunMain',
445+
projectFile: await computeProject(),
446+
main: main.mainRelPath(),
447+
},
448+
};
442449
const name = `${allTaskProperties['buildAndRunMain'].title}${basename(
443450
main.mainRelPath()
444451
)}`;

integration/vscode/ada/test/suite/general/tasks.test.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,24 @@ suite('GPR Tasks Provider', function () {
2121
assert.notStrictEqual(tasks, undefined);
2222

2323
const expectedTasksNames: string[] = [
24-
'ada: Build current project',
25-
'ada: Check current file',
26-
'ada: Clean current project',
27-
'ada: Build main - main1.adb',
28-
'ada: Build and run main - main1.adb',
29-
'ada: Build main - test.adb',
30-
'ada: Build and run main - test.adb',
24+
'ada: Build current project - kind: buildProject',
25+
'ada: Check current file - kind: checkFile',
26+
'ada: Clean current project - kind: cleanProject',
27+
'ada: Build main - main1.adb - kind: buildMain',
28+
'ada: Build and run main - main1.adb - kind: buildAndRunMain',
29+
'ada: Build main - test.adb - kind: buildMain',
30+
'ada: Build and run main - test.adb - kind: buildAndRunMain',
3131
];
3232

3333
assert.strictEqual(
34-
tasks.map((t) => `${t.source}: ${t.name}`).join('\n'),
34+
tasks
35+
.map(
36+
(t) =>
37+
`${t.source}: ${t.name} - kind: ${
38+
(t.definition as CustomTaskDefinition).configuration.kind
39+
}`
40+
)
41+
.join('\n'),
3542
expectedTasksNames.join('\n')
3643
);
3744
});

0 commit comments

Comments
 (0)