Skip to content

Commit c65738f

Browse files
Merge branch 'topic/restart_server' into 'master'
Add a Kill_Process procedure to LSP clients See merge request eng/ide/ada_language_server!1465
2 parents 2f264ac + 4a032fb commit c65738f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

source/client/lsp-raw_clients.adb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ package body LSP.Raw_Clients is
139139
return Self.Server.Identifier;
140140
end Server_PID;
141141

142+
------------------
143+
-- Kill_Process --
144+
------------------
145+
146+
procedure Kill_Process (Self : in out Raw_Client'Class) is
147+
begin
148+
Self.Server.Kill_Process;
149+
end Kill_Process;
150+
142151
-------------------
143152
-- Set_Arguments --
144153
-------------------

source/client/lsp-raw_clients.ads

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,17 @@ package LSP.Raw_Clients is
112112

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

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

120+
procedure Kill_Process (Self : in out Raw_Client'Class);
121+
-- Kill current server process. Process will exit immediately.
122+
--
123+
-- On Windows, TerminateProcess() is called, and on POSIX, the SIGKILL
124+
-- signal is sent.
125+
120126
private
121127
type Listener (Client : access Raw_Client'Class) is limited
122128
new Spawn.Processes.Process_Listener with null record;

0 commit comments

Comments
 (0)