Skip to content

Commit

Permalink
Merge branch 'topic/cargs' into 'master'
Browse files Browse the repository at this point in the history
Extra quoting around `-cargs:ada`

Closes #1571

See merge request eng/ide/ada_language_server!1865
  • Loading branch information
reznikmm committed Dec 19, 2024
2 parents 1b326aa + c32a84b commit 965730c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion integration/vscode/ada/src/gnatTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export async function computeProject(): 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'];
return p_gnatef;
};
export function getScenarioArgs() {
Expand Down
2 changes: 1 addition & 1 deletion integration/vscode/ada/src/gnattest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ async function buildTestDriver(run: vscode.TestRun) {
*/
const driverPrjPath = await getGnatTestDriverProjectPath();
run.appendOutput(`Building the test harness project\r\n`);
const gprbuild = logAndRun(run, ['gprbuild', '-P', driverPrjPath, '-cargs:ada', '-gnatef']);
const gprbuild = logAndRun(run, ['gprbuild', '-P', driverPrjPath, "'-cargs:ada'", '-gnatef']);

prepareAndAppendOutput(run, gprbuild.stdout.toLocaleString());
prepareAndAppendOutput(run, gprbuild.stderr.toLocaleString());
Expand Down
10 changes: 5 additions & 5 deletions integration/vscode/ada/src/taskProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const TASK_BUILD_PROJECT: PredefinedTask = {
taskDef: {
type: TASK_TYPE_ADA,
command: 'gprbuild',
args: ['${command:ada.gprProjectArgs}', '-cargs:ada', '-gnatef'],
args: ['${command:ada.gprProjectArgs}', "'-cargs:ada'", '-gnatef'],
},
problemMatchers: DEFAULT_PROBLEM_MATCHER,
taskGroup: vscode.TaskGroup.Build,
Expand Down Expand Up @@ -115,7 +115,7 @@ const predefinedTasks: PredefinedTask[] = [
'-gnatc',
'${command:ada.gprProjectArgs}',
'${fileBasename}',
'-cargs:ada',
"'-cargs:ada'",
'-gnatef',
],
},
Expand All @@ -133,7 +133,7 @@ const predefinedTasks: PredefinedTask[] = [
'-u',
'${command:ada.gprProjectArgs}',
'${fileBasename}',
'-cargs:ada',
"'-cargs:ada'",
'-gnatef',
],
},
Expand Down Expand Up @@ -411,7 +411,7 @@ export class SimpleTaskProvider implements vscode.TaskProvider {
args: [
`\${command:${CMD_GPR_PROJECT_ARGS}}`,
main.mainRelPath(),
'-cargs:ada',
"'-cargs:ada'",
'-gnatef',
],
},
Expand Down Expand Up @@ -1115,7 +1115,7 @@ function updateToAlire(taskDef: SimpleTaskDef): SimpleTaskDef {
* scenario args because they are managed by ALIRE.
*
*/
args.splice(0, args.length, 'build', '--', '-cargs:ada', '-gnatef');
args.splice(0, args.length, 'build', '--', "'-cargs:ada'", '-gnatef');
} else if (taskDef == TASK_CLEAN_PROJECT.taskDef) {
/**
* Replace the entire command with `alr clean`. Ignore project and
Expand Down
14 changes: 7 additions & 7 deletions integration/vscode/ada/test/general/tasks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ ada: Build and run main - src/test.adb
test('Ada task command lines', async function () {
const expectedCmdLines = `
ada: Clean current project - gprclean -P ${projectPath}
ada: Build current project - gprbuild -P ${projectPath} -cargs:ada -gnatef
ada: Check current file - gprbuild -q -f -c -u -gnatc -P ${projectPath} \${fileBasename} -cargs:ada -gnatef
ada: Compile current file - gprbuild -q -f -c -u -P ${projectPath} \${fileBasename} -cargs:ada -gnatef
ada: Build current project - gprbuild -P ${projectPath} '-cargs:ada' -gnatef
ada: Check current file - gprbuild -q -f -c -u -gnatc -P ${projectPath} \${fileBasename} '-cargs:ada' -gnatef
ada: Compile current file - gprbuild -q -f -c -u -P ${projectPath} \${fileBasename} '-cargs:ada' -gnatef
ada: Generate documentation from the project - gnatdoc -P ${projectPath}
ada: Build main - src/main1.adb - gprbuild -P ${projectPath} src/main1.adb -cargs:ada -gnatef
ada: Build main - src/main1.adb - gprbuild -P ${projectPath} src/main1.adb '-cargs:ada' -gnatef
ada: Run main - src/main1.adb - .${path.sep}obj${path.sep}main1exec${exe}
ada: Build main - src/test.adb - gprbuild -P ${projectPath} src/test.adb -cargs:ada -gnatef
ada: Build main - src/test.adb - gprbuild -P ${projectPath} src/test.adb '-cargs:ada' -gnatef
ada: Run main - src/test.adb - .${path.sep}obj${path.sep}test${exe}
`.trim();

Expand Down Expand Up @@ -167,7 +167,7 @@ ada: Run main - src/test.adb - .${path.sep}obj${path.sep}test${exe}
args: [
'${command:ada.gprProjectArgs}',
'--no-object-check',
'-cargs:ada',
"'-cargs:ada'",
'-gnatef',
],
label: 'ada: Build current project',
Expand Down Expand Up @@ -195,7 +195,7 @@ ada: Run main - src/test.adb - .${path.sep}obj${path.sep}test${exe}
// The '--no-object-check' switch has been added to the 'ada: Build current project'
// predefined task in the workspace's tasks.json file: check that it's indeed present
// in the returned task's command line.
const expectedCmd = `gprbuild -P ${projectPath} --no-object-check -cargs:ada -gnatef`;
const expectedCmd = `gprbuild -P ${projectPath} --no-object-check '-cargs:ada' -gnatef`;

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

0 comments on commit 965730c

Please sign in to comment.