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 May 1, 2024
2 parents c22e484 + 368b358 commit c780804
Show file tree
Hide file tree
Showing 19 changed files with 244 additions and 92 deletions.
18 changes: 9 additions & 9 deletions source/ada/lsp-ada_declaration.adb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ with Laltools.Common;

with LSP.Ada_Context_Sets;
with LSP.Ada_Handlers.Locations;
with LSP.Ada_Request_Jobs;
with LSP.Client_Message_Receivers;
with LSP.Enumerations;
with LSP.Locations;
with LSP.Server_Request_Jobs;
with LSP.Server_Requests.Declaration;
with LSP.Structures;

Expand All @@ -44,7 +44,7 @@ package body LSP.Ada_Declaration is

type Ada_Declaration_Job
(Parent : not null access constant Ada_Declaration_Handler) is limited
new LSP.Server_Request_Jobs.Server_Request_Job
new LSP.Ada_Request_Jobs.Ada_Request_Job
(Priority => LSP.Server_Jobs.High)
with record
Response : LSP.Structures.Location_Vector;
Expand All @@ -54,7 +54,7 @@ package body LSP.Ada_Declaration is

type Ada_Declaration_Job_Access is access all Ada_Declaration_Job;

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Ada_Declaration_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand Down Expand Up @@ -86,19 +86,19 @@ package body LSP.Ada_Declaration is
Result : constant Ada_Declaration_Job_Access :=
new Ada_Declaration_Job'
(Parent => Self'Unchecked_Access,
Request => LSP.Server_Request_Jobs.Request_Access (Message),
Request => LSP.Ada_Request_Jobs.Request_Access (Message),
others => <>);
begin
Result.Contexts := Self.Context.Contexts_For_File (File);

return LSP.Server_Jobs.Server_Job_Access (Result);
end Create_Job;

---------------------
-- Execute_Request --
---------------------
-------------------------
-- Execute_Ada_Request --
-------------------------

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Ada_Declaration_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand Down Expand Up @@ -256,6 +256,6 @@ package body LSP.Ada_Declaration is
end loop;
end;
end if;
end Execute_Request;
end Execute_Ada_Request;

end LSP.Ada_Declaration;
18 changes: 9 additions & 9 deletions source/ada/lsp-ada_definition.adb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ with Laltools.Common;

with LSP.Ada_Context_Sets;
with LSP.Ada_Handlers.Locations;
with LSP.Ada_Request_Jobs;
with LSP.Client_Message_Receivers;
with LSP.Enumerations;
with LSP.Locations;
with LSP.Server_Request_Jobs;
with LSP.Server_Requests.Definition;
with LSP.Structures;

Expand All @@ -44,7 +44,7 @@ package body LSP.Ada_Definition is

type Ada_Definition_Job
(Parent : not null access constant Ada_Definition_Handler) is limited
new LSP.Server_Request_Jobs.Server_Request_Job
new LSP.Ada_Request_Jobs.Ada_Request_Job
(Priority => LSP.Server_Jobs.High)
with record
Response : LSP.Structures.Location_Vector;
Expand All @@ -54,7 +54,7 @@ package body LSP.Ada_Definition is

type Ada_Definition_Job_Access is access all Ada_Definition_Job;

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Ada_Definition_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand All @@ -79,19 +79,19 @@ package body LSP.Ada_Definition is
Result : constant Ada_Definition_Job_Access :=
new Ada_Definition_Job'
(Parent => Self'Unchecked_Access,
Request => LSP.Server_Request_Jobs.Request_Access (Message),
Request => LSP.Ada_Request_Jobs.Request_Access (Message),
others => <>);
begin
Result.Contexts := Self.Context.Contexts_For_File (File);

return LSP.Server_Jobs.Server_Job_Access (Result);
end Create_Job;

---------------------
-- Execute_Request --
---------------------
-------------------------
-- Execute_Ada_Request --
-------------------------

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Ada_Definition_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand Down Expand Up @@ -274,6 +274,6 @@ package body LSP.Ada_Definition is
Accept_Node.F_Body_Decl.F_Name);
end loop;
end if;
end Execute_Request;
end Execute_Ada_Request;

end LSP.Ada_Definition;
5 changes: 4 additions & 1 deletion source/ada/lsp-ada_did_change_configurations.adb
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ package body LSP.Ada_Did_Change_Configurations is
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Status : out LSP.Server_Jobs.Execution_Status) is
begin
Status := LSP.Server_Jobs.Done;
Self.Parent.Context.Set_Configuration (Self.Configuration);

if Self.Reload then
Self.Parent.Context.Reload_Project;
end if;

Status := LSP.Server_Jobs.Done;
exception
when E : others =>
Self.Parent.Context.Trace_Exception (E);
end Execute;

----------------
Expand Down
3 changes: 3 additions & 0 deletions source/ada/lsp-ada_did_change_document.adb
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ package body LSP.Ada_Did_Change_Document is
end if;

-- Rest of the work in Complete routine
exception
when E : others =>
Self.Parent.Context.Trace_Exception (E);
end Execute;

end LSP.Ada_Did_Change_Document;
38 changes: 19 additions & 19 deletions source/ada/lsp-ada_document_symbol.adb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ with VSS.Characters;
with VSS.Strings;

with LSP.Ada_Context_Sets;
with LSP.Constants;
with LSP.Ada_Request_Jobs;
with LSP.Client_Message_Receivers;
with LSP.Constants;
with LSP.Enumerations;
with LSP.Server_Request_Jobs;
with LSP.Search;
with LSP.Server_Requests.DocumentSymbol;
with LSP.Structures;
with LSP.Search;
with LSP.Utils;

package body LSP.Ada_Document_Symbol is
Expand All @@ -54,15 +54,15 @@ package body LSP.Ada_Document_Symbol is

type Flat_Document_Symbol_Job
(Parent : not null access constant Ada_Document_Symbol_Handler) is limited
new LSP.Server_Request_Jobs.Server_Request_Job
new LSP.Ada_Request_Jobs.Ada_Request_Job
(Priority => LSP.Server_Jobs.Low)
with record
Pattern : Search_Pattern_Access;
Cursor : Traverse_Iterator_Access;
Response : LSP.Structures.DocumentSymbol_Result;
end record;

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Flat_Document_Symbol_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand All @@ -78,15 +78,15 @@ package body LSP.Ada_Document_Symbol is

type Full_Document_Symbol_Job
(Parent : not null access constant Ada_Document_Symbol_Handler) is limited
new LSP.Server_Request_Jobs.Server_Request_Job
new LSP.Ada_Request_Jobs.Ada_Request_Job
(Priority => LSP.Server_Jobs.Low)
with record
Pattern : Search_Pattern_Access;
Node : Libadalang.Analysis.Ada_Node;
Stack : Stack_Item_Lists.List;
end record;

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Full_Document_Symbol_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand Down Expand Up @@ -168,7 +168,7 @@ package body LSP.Ada_Document_Symbol is
function Flat_Job return LSP.Server_Jobs.Server_Job_Access is
(new Flat_Document_Symbol_Job'
(Parent => Self'Unchecked_Access,
Request => LSP.Server_Request_Jobs.Request_Access (Message),
Request => LSP.Ada_Request_Jobs.Request_Access (Message),
Cursor => new Libadalang.Iterators.Traverse_Iterator'Class'
(Libadalang.Iterators.Find (Unit.Root, Is_Defining_Name)),
Pattern => new LSP.Search.Search_Pattern'Class'
Expand All @@ -184,7 +184,7 @@ package body LSP.Ada_Document_Symbol is
function Full_Job return LSP.Server_Jobs.Server_Job_Access is
(new Full_Document_Symbol_Job'
(Parent => Self'Unchecked_Access,
Request => LSP.Server_Request_Jobs.Request_Access (Message),
Request => LSP.Ada_Request_Jobs.Request_Access (Message),
Node => Unit.Root,
Stack => [(Node => Libadalang.Analysis.No_Ada_Node,
Children => <>)],
Expand All @@ -204,11 +204,11 @@ package body LSP.Ada_Document_Symbol is
end if;
end Create_Job;

---------------------
-- Execute_Request --
---------------------
-------------------------
-- Execute_Ada_Request --
-------------------------

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Flat_Document_Symbol_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand Down Expand Up @@ -254,13 +254,13 @@ package body LSP.Ada_Document_Symbol is
Free (Self.Cursor);
Status := LSP.Server_Jobs.Done;
end if;
end Execute_Request;
end Execute_Ada_Request;

---------------------
-- Execute_Request --
---------------------
-------------------------
-- Execute_Ada_Request --
-------------------------

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Full_Document_Symbol_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand Down Expand Up @@ -583,7 +583,7 @@ package body LSP.Ada_Document_Symbol is
Variant_2 => Self.Stack.Last_Element.Children));
Status := LSP.Server_Jobs.Done;
end if;
end Execute_Request;
end Execute_Ada_Request;

-----------------
-- Get_Profile --
Expand Down
1 change: 1 addition & 0 deletions source/ada/lsp-ada_empty_handlers.ads
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ with LSP.Server_Request_Receivers;
with LSP.Structures;

package LSP.Ada_Empty_Handlers is
pragma Preelaborate;

type Empty_Message_Handler
(Sender : not null access LSP.Client_Message_Receivers
Expand Down
18 changes: 9 additions & 9 deletions source/ada/lsp-ada_folding_range.adb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ with Libadalang.Iterators;
with VSS.Strings;

with LSP.Ada_Context_Sets;
with LSP.Ada_Request_Jobs;
with LSP.Client_Message_Receivers;
with LSP.Constants;
with LSP.Server_Request_Jobs;
with LSP.Server_Requests.FoldingRange;
with LSP.Structures;

Expand All @@ -42,7 +42,7 @@ package body LSP.Ada_Folding_Range is

type Folding_Range_Job
(Parent : not null access constant Ada_Folding_Range_Handler) is limited
new LSP.Server_Request_Jobs.Server_Request_Job
new LSP.Ada_Request_Jobs.Ada_Request_Job
(Priority => LSP.Server_Jobs.Low)
with record
Lines_Only : Boolean;
Expand All @@ -51,7 +51,7 @@ package body LSP.Ada_Folding_Range is
Response : LSP.Structures.FoldingRange_Vector;
end record;

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Folding_Range_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand Down Expand Up @@ -245,7 +245,7 @@ package body LSP.Ada_Folding_Range is
Job : constant LSP.Server_Jobs.Server_Job_Access :=
new Folding_Range_Job'
(Parent => Self'Unchecked_Access,
Request => LSP.Server_Request_Jobs.Request_Access (Message),
Request => LSP.Ada_Request_Jobs.Request_Access (Message),
Unit => Unit,
Cursor => new Libadalang.Iterators.Traverse_Iterator'Class'
(Libadalang.Iterators.Traverse (Unit.Root)),
Expand All @@ -255,11 +255,11 @@ package body LSP.Ada_Folding_Range is
return Job;
end Create_Job;

---------------------
-- Execute_Request --
---------------------
-------------------------
-- Execute_Ada_Request --
-------------------------

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Folding_Range_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand Down Expand Up @@ -292,5 +292,5 @@ package body LSP.Ada_Folding_Range is
end;
end if;
end loop;
end Execute_Request;
end Execute_Ada_Request;
end LSP.Ada_Folding_Range;
18 changes: 9 additions & 9 deletions source/ada/lsp-ada_hover.adb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ with VSS.Strings;

with LSP.Ada_Context_Sets;
with LSP.Ada_Documentation;
with LSP.Ada_Request_Jobs;
with LSP.Client_Message_Receivers;
with LSP.Predefined_Completion;
with LSP.Server_Request_Jobs;
with LSP.Server_Requests.Hover;
with LSP.Structures;
with LSP.Utils;
Expand All @@ -34,13 +34,13 @@ package body LSP.Ada_Hover is

type Ada_Hover_Job
(Parent : not null access constant Ada_Hover_Handler) is limited
new LSP.Server_Request_Jobs.Server_Request_Job
new LSP.Ada_Request_Jobs.Ada_Request_Job
(Priority => LSP.Server_Jobs.High)
with null record;

type Ada_Hover_Job_Access is access all Ada_Hover_Job;

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Ada_Hover_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand All @@ -58,16 +58,16 @@ package body LSP.Ada_Hover is
Result : constant Ada_Hover_Job_Access :=
new Ada_Hover_Job'
(Parent => Self'Unchecked_Access,
Request => LSP.Server_Request_Jobs.Request_Access (Message));
Request => LSP.Ada_Request_Jobs.Request_Access (Message));
begin
return LSP.Server_Jobs.Server_Job_Access (Result);
end Create_Job;

---------------------
-- Execute_Request --
---------------------
-------------------------
-- Execute_Ada_Request --
-------------------------

overriding procedure Execute_Request
overriding procedure Execute_Ada_Request
(Self : in out Ada_Hover_Job;
Client :
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
Expand Down Expand Up @@ -203,6 +203,6 @@ package body LSP.Ada_Hover is
end if;

Client.On_Hover_Response (Message.Id, Response);
end Execute_Request;
end Execute_Ada_Request;

end LSP.Ada_Hover;
Loading

0 comments on commit c780804

Please sign in to comment.