Skip to content

Commit 6b50e0e

Browse files
committed
Drop Has_Pending_Work from Server's API
Refs #1141
1 parent ff4ce7b commit 6b50e0e

File tree

4 files changed

+3
-27
lines changed

4 files changed

+3
-27
lines changed

source/ada/lsp-ada_indexing.adb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,7 @@ package body LSP.Ada_Indexing is
9999
Emit_Progress_Report
100100
(Self.Total_Files_Indexed, Self.Total_Files_To_Index);
101101

102-
-- Check whether another request is pending. If so, pause
103-
-- the indexing; it will be resumed later as part of
104-
-- After_Request.
105-
106-
exit when Self.Server.Has_Pending_Work;
102+
exit;
107103
end if;
108104

109105
end;
@@ -142,8 +138,7 @@ package body LSP.Ada_Indexing is
142138
Handler.Allocate_Progress_Token ("indexing");
143139
Job : LSP.Server_Jobs.Server_Job_Access :=
144140
new Indexing_Job'
145-
(Server => Server,
146-
Handler => Handler,
141+
(Handler => Handler,
147142
Files_To_Index => Files,
148143
Indexing_Token => Token,
149144
Total_Files_Indexed => 0,

source/ada/lsp-ada_indexing.ads

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ private
6363
-- schedule new indexing job
6464

6565
type Indexing_Job
66-
(Server : not null access LSP.Servers.Server'Class;
67-
Handler : not null access LSP.Ada_Handlers.Message_Handler'Class) is
66+
(Handler : not null access LSP.Ada_Handlers.Message_Handler'Class) is
6867
new LSP.Server_Jobs.Server_Job with
6968
record
7069
Files_To_Index : File_Sets.Set;

source/server/lsp-servers.adb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -975,17 +975,4 @@ package body LSP.Servers is
975975
return Self.Look_Ahead;
976976
end Look_Ahead_Message;
977977

978-
----------------------
979-
-- Has_Pending_Work --
980-
----------------------
981-
982-
function Has_Pending_Work (Self : Server) return Boolean is
983-
use type Ada.Task_Identification.Task_Id;
984-
begin
985-
pragma Assert
986-
(Ada.Task_Identification.Current_Task = Self.Processing_Task'Identity);
987-
988-
return Self.Input_Queue_Length > 0;
989-
end Has_Pending_Work;
990-
991978
end LSP.Servers;

source/server/lsp-servers.ads

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,6 @@ package LSP.Servers is
104104
-- Return number of messages pending in Input_Queue.
105105
-- For debug purposes only!
106106

107-
function Has_Pending_Work (Self : Server) return Boolean;
108-
-- Return True if the server has work in the queue, other than the
109-
-- notification/request it's currently processing. This should only be
110-
-- called from the processing task.
111-
112107
procedure Enqueue
113108
(Self : in out Server'Class;
114109
Job : in out LSP.Server_Jobs.Server_Job_Access);

0 commit comments

Comments
 (0)