@@ -50,7 +50,6 @@ package body LSP.Ada_References is
5050 (Parent : not null access constant Ada_References_Handler)
5151 is limited new LSP.Server_Jobs.Server_Job with record
5252 Message : LSP.Server_Messages.Server_Message_Access;
53- Is_Done : Boolean := False;
5453 Is_Enum : Boolean := False;
5554 Response : LSP.Structures.Location_Vector_Or_Null;
5655 Filter : LSP.Locations.File_Span_Sets.Set;
@@ -67,13 +66,11 @@ package body LSP.Ada_References is
6766 (Self : Ada_References_Job) return LSP.Server_Jobs.Job_Priority is
6867 (LSP.Server_Jobs.Low);
6968
70- overriding function Is_Done (Self : Ada_References_Job) return Boolean is
71- (Self.Is_Done);
72-
7369 overriding procedure Execute
7470 (Self : in out Ada_References_Job;
7571 Client :
76- in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class);
72+ in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
73+ Status : out LSP.Server_Jobs.Execution_Status);
7774
7875 overriding function Message (Self : Ada_References_Job)
7976 return LSP.Server_Messages.Server_Message_Access is (Self.Message);
@@ -119,7 +116,8 @@ package body LSP.Ada_References is
119116 overriding procedure Execute
120117 (Self : in out Ada_References_Job;
121118 Client :
122- in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class)
119+ in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
120+ Status : out LSP.Server_Jobs.Execution_Status)
123121 is
124122 procedure Callback
125123 (Node : Libadalang.Analysis.Base_Id;
@@ -223,14 +221,16 @@ package body LSP.Ada_References is
223221 if LSP.Ada_File_Sets.File_Sets.Has_Element (Self.Cursor) then
224222 Units (1 ) := Self.Context.Get_AU
225223 (LSP.Ada_File_Sets.File_Sets.Element (Self.Cursor));
224+
226225 LSP.Ada_Id_Iterators.Find_All_References
227226 (Self.Definition, Units, Callback'Access );
227+
228+ Status := LSP.Server_Jobs.Continue;
228229 else
229230 Free (Self.Iterator);
230- Self.Is_Done := True;
231-
232231 LSP.Ada_Handlers.Locations.Sort (Self.Response);
233232 Client.On_References_Response (Message.Id, Self.Response);
233+ Status := LSP.Server_Jobs.Done;
234234 end if ;
235235 end Execute ;
236236
0 commit comments