Skip to content

Commit

Permalink
Merge remote branch 'origin/master' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
automatic-merge committed Dec 14, 2023
2 parents ffbd88d + 80a91c4 commit a844395
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 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', '-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
9 changes: 9 additions & 0 deletions source/client/lsp-raw_clients.adb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ package body LSP.Raw_Clients is
return Self.Server.Identifier;
end Server_PID;

------------------
-- Kill_Process --
------------------

procedure Kill_Process (Self : in out Raw_Client'Class) is
begin
Self.Server.Kill_Process;
end Kill_Process;

-------------------
-- Set_Arguments --
-------------------
Expand Down
8 changes: 7 additions & 1 deletion source/client/lsp-raw_clients.ads
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,17 @@ package LSP.Raw_Clients is

function Can_Send_Message (Self : Raw_Client'Class) return Boolean;
-- Return True when server's process is running and send queue is empty,
-- thus send operation can start immidiately.
-- thus send operation can start immediately.

function Server_PID (Self : Raw_Client'Class) return String;
-- Return server process id (pid) if the server has been started.

procedure Kill_Process (Self : in out Raw_Client'Class);
-- Kill current server process. Process will exit immediately.
--
-- On Windows, TerminateProcess() is called, and on POSIX, the SIGKILL
-- signal is sent.

private
type Listener (Client : access Raw_Client'Class) is limited
new Spawn.Processes.Process_Listener with null record;
Expand Down

0 comments on commit a844395

Please sign in to comment.