Skip to content

Commit

Permalink
Merge branch 'topic/fix-gnatef2' into 'master'
Browse files Browse the repository at this point in the history
Add extra quotes around `-cargs:ada` in vscode tasks

Closes #1268

See merge request eng/ide/ada_language_server!1467
  • Loading branch information
reznikmm committed Dec 13, 2023
2 parents c65738f + 8b2b475 commit 80a91c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion integration/vscode/ada/src/taskProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ async function computeProject(taskDef?: CustomTaskDefinition): Promise<string> {

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

Expand Down
6 changes: 3 additions & 3 deletions integration/vscode/ada/test/suite/general/tasks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ suite('GPR Tasks Provider', function () {
const exec = resolved.execution as vscode.ShellExecution;
const actualCmd = [exec.command].concat(exec.args).join(' ');

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

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

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

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

assert.strictEqual(actualCmd, expectedCmd);
});
Expand Down

0 comments on commit 80a91c4

Please sign in to comment.