Skip to content

Commit 80a91c4

Browse files
committed
Merge branch 'topic/fix-gnatef2' into 'master'
Add extra quotes around `-cargs:ada` in vscode tasks Closes #1268 See merge request eng/ide/ada_language_server!1467
2 parents c65738f + 8b2b475 commit 80a91c4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

integration/vscode/ada/src/taskProviders.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ async function computeProject(taskDef?: CustomTaskDefinition): Promise<string> {
8080

8181
// Call commonArgs on args and append `-gnatef` to generate full file names in errors/warnings
8282
export const getDiagnosticArgs = (): string[] => {
83-
const p_gnatef = ['-cargs:ada', '-gnatef'];
83+
const p_gnatef = ['"-cargs:ada"', '-gnatef'];
84+
// PowerShell splits arguments on `:`, so we need extra quotes around `-cargs:ada`
8485
return p_gnatef;
8586
};
8687

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ suite('GPR Tasks Provider', function () {
8484
const exec = resolved.execution as vscode.ShellExecution;
8585
const actualCmd = [exec.command].concat(exec.args).join(' ');
8686

87-
const expectedCmd = `gprbuild -P ${def.configuration.projectFile} -cargs -gnatef`;
87+
const expectedCmd = `gprbuild -P ${def.configuration.projectFile} "-cargs:ada" -gnatef`;
8888

8989
assert.strictEqual(actualCmd, expectedCmd);
9090
});
@@ -111,7 +111,7 @@ suite('GPR Tasks Provider', function () {
111111

112112
const expectedCmd = `gprbuild -P ${def.configuration.projectFile} ${
113113
def.configuration.main ?? ''
114-
} -cargs -gnatef`;
114+
} "-cargs:ada" -gnatef`;
115115

116116
assert.strictEqual(actualCmd, expectedCmd);
117117
});
@@ -140,7 +140,7 @@ suite('GPR Tasks Provider', function () {
140140
// via project attributes
141141
const expectedCmd = `gprbuild -P ${def.configuration.projectFile} ${
142142
def.configuration.main ?? ''
143-
} -cargs -gnatef && obj/main1exec${process.platform == 'win32' ? '.exe' : ''}`;
143+
} "-cargs:ada" -gnatef && obj/main1exec${process.platform == 'win32' ? '.exe' : ''}`;
144144

145145
assert.strictEqual(actualCmd, expectedCmd);
146146
});

0 commit comments

Comments
 (0)