Skip to content

Commit 368b358

Browse files
committed
Merge branch 'topic/err_hdl' into 'master'
Restore lost exception handlers See merge request eng/ide/ada_language_server!1557
2 parents a51dab0 + 8946f7a commit 368b358

19 files changed

+244
-92
lines changed

source/ada/lsp-ada_declaration.adb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ with Laltools.Common;
2525

2626
with LSP.Ada_Context_Sets;
2727
with LSP.Ada_Handlers.Locations;
28+
with LSP.Ada_Request_Jobs;
2829
with LSP.Client_Message_Receivers;
2930
with LSP.Enumerations;
3031
with LSP.Locations;
31-
with LSP.Server_Request_Jobs;
3232
with LSP.Server_Requests.Declaration;
3333
with LSP.Structures;
3434

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

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

5555
type Ada_Declaration_Job_Access is access all Ada_Declaration_Job;
5656

57-
overriding procedure Execute_Request
57+
overriding procedure Execute_Ada_Request
5858
(Self : in out Ada_Declaration_Job;
5959
Client :
6060
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -86,19 +86,19 @@ package body LSP.Ada_Declaration is
8686
Result : constant Ada_Declaration_Job_Access :=
8787
new Ada_Declaration_Job'
8888
(Parent => Self'Unchecked_Access,
89-
Request => LSP.Server_Request_Jobs.Request_Access (Message),
89+
Request => LSP.Ada_Request_Jobs.Request_Access (Message),
9090
others => <>);
9191
begin
9292
Result.Contexts := Self.Context.Contexts_For_File (File);
9393

9494
return LSP.Server_Jobs.Server_Job_Access (Result);
9595
end Create_Job;
9696

97-
---------------------
98-
-- Execute_Request --
99-
---------------------
97+
-------------------------
98+
-- Execute_Ada_Request --
99+
-------------------------
100100

101-
overriding procedure Execute_Request
101+
overriding procedure Execute_Ada_Request
102102
(Self : in out Ada_Declaration_Job;
103103
Client :
104104
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -256,6 +256,6 @@ package body LSP.Ada_Declaration is
256256
end loop;
257257
end;
258258
end if;
259-
end Execute_Request;
259+
end Execute_Ada_Request;
260260

261261
end LSP.Ada_Declaration;

source/ada/lsp-ada_definition.adb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ with Laltools.Common;
2525

2626
with LSP.Ada_Context_Sets;
2727
with LSP.Ada_Handlers.Locations;
28+
with LSP.Ada_Request_Jobs;
2829
with LSP.Client_Message_Receivers;
2930
with LSP.Enumerations;
3031
with LSP.Locations;
31-
with LSP.Server_Request_Jobs;
3232
with LSP.Server_Requests.Definition;
3333
with LSP.Structures;
3434

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

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

5555
type Ada_Definition_Job_Access is access all Ada_Definition_Job;
5656

57-
overriding procedure Execute_Request
57+
overriding procedure Execute_Ada_Request
5858
(Self : in out Ada_Definition_Job;
5959
Client :
6060
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -79,19 +79,19 @@ package body LSP.Ada_Definition is
7979
Result : constant Ada_Definition_Job_Access :=
8080
new Ada_Definition_Job'
8181
(Parent => Self'Unchecked_Access,
82-
Request => LSP.Server_Request_Jobs.Request_Access (Message),
82+
Request => LSP.Ada_Request_Jobs.Request_Access (Message),
8383
others => <>);
8484
begin
8585
Result.Contexts := Self.Context.Contexts_For_File (File);
8686

8787
return LSP.Server_Jobs.Server_Job_Access (Result);
8888
end Create_Job;
8989

90-
---------------------
91-
-- Execute_Request --
92-
---------------------
90+
-------------------------
91+
-- Execute_Ada_Request --
92+
-------------------------
9393

94-
overriding procedure Execute_Request
94+
overriding procedure Execute_Ada_Request
9595
(Self : in out Ada_Definition_Job;
9696
Client :
9797
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -274,6 +274,6 @@ package body LSP.Ada_Definition is
274274
Accept_Node.F_Body_Decl.F_Name);
275275
end loop;
276276
end if;
277-
end Execute_Request;
277+
end Execute_Ada_Request;
278278

279279
end LSP.Ada_Definition;

source/ada/lsp-ada_did_change_configurations.adb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,16 @@ package body LSP.Ada_Did_Change_Configurations is
5454
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
5555
Status : out LSP.Server_Jobs.Execution_Status) is
5656
begin
57+
Status := LSP.Server_Jobs.Done;
5758
Self.Parent.Context.Set_Configuration (Self.Configuration);
5859

5960
if Self.Reload then
6061
Self.Parent.Context.Reload_Project;
6162
end if;
6263

63-
Status := LSP.Server_Jobs.Done;
64+
exception
65+
when E : others =>
66+
Self.Parent.Context.Trace_Exception (E);
6467
end Execute;
6568

6669
----------------

source/ada/lsp-ada_did_change_document.adb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ package body LSP.Ada_Did_Change_Document is
171171
end if;
172172

173173
-- Rest of the work in Complete routine
174+
exception
175+
when E : others =>
176+
Self.Parent.Context.Trace_Exception (E);
174177
end Execute;
175178

176179
end LSP.Ada_Did_Change_Document;

source/ada/lsp-ada_document_symbol.adb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ with VSS.Characters;
3030
with VSS.Strings;
3131

3232
with LSP.Ada_Context_Sets;
33-
with LSP.Constants;
33+
with LSP.Ada_Request_Jobs;
3434
with LSP.Client_Message_Receivers;
35+
with LSP.Constants;
3536
with LSP.Enumerations;
36-
with LSP.Server_Request_Jobs;
37+
with LSP.Search;
3738
with LSP.Server_Requests.DocumentSymbol;
3839
with LSP.Structures;
39-
with LSP.Search;
4040
with LSP.Utils;
4141

4242
package body LSP.Ada_Document_Symbol is
@@ -54,15 +54,15 @@ package body LSP.Ada_Document_Symbol is
5454

5555
type Flat_Document_Symbol_Job
5656
(Parent : not null access constant Ada_Document_Symbol_Handler) is limited
57-
new LSP.Server_Request_Jobs.Server_Request_Job
57+
new LSP.Ada_Request_Jobs.Ada_Request_Job
5858
(Priority => LSP.Server_Jobs.Low)
5959
with record
6060
Pattern : Search_Pattern_Access;
6161
Cursor : Traverse_Iterator_Access;
6262
Response : LSP.Structures.DocumentSymbol_Result;
6363
end record;
6464

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

7979
type Full_Document_Symbol_Job
8080
(Parent : not null access constant Ada_Document_Symbol_Handler) is limited
81-
new LSP.Server_Request_Jobs.Server_Request_Job
81+
new LSP.Ada_Request_Jobs.Ada_Request_Job
8282
(Priority => LSP.Server_Jobs.Low)
8383
with record
8484
Pattern : Search_Pattern_Access;
8585
Node : Libadalang.Analysis.Ada_Node;
8686
Stack : Stack_Item_Lists.List;
8787
end record;
8888

89-
overriding procedure Execute_Request
89+
overriding procedure Execute_Ada_Request
9090
(Self : in out Full_Document_Symbol_Job;
9191
Client :
9292
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -168,7 +168,7 @@ package body LSP.Ada_Document_Symbol is
168168
function Flat_Job return LSP.Server_Jobs.Server_Job_Access is
169169
(new Flat_Document_Symbol_Job'
170170
(Parent => Self'Unchecked_Access,
171-
Request => LSP.Server_Request_Jobs.Request_Access (Message),
171+
Request => LSP.Ada_Request_Jobs.Request_Access (Message),
172172
Cursor => new Libadalang.Iterators.Traverse_Iterator'Class'
173173
(Libadalang.Iterators.Find (Unit.Root, Is_Defining_Name)),
174174
Pattern => new LSP.Search.Search_Pattern'Class'
@@ -184,7 +184,7 @@ package body LSP.Ada_Document_Symbol is
184184
function Full_Job return LSP.Server_Jobs.Server_Job_Access is
185185
(new Full_Document_Symbol_Job'
186186
(Parent => Self'Unchecked_Access,
187-
Request => LSP.Server_Request_Jobs.Request_Access (Message),
187+
Request => LSP.Ada_Request_Jobs.Request_Access (Message),
188188
Node => Unit.Root,
189189
Stack => [(Node => Libadalang.Analysis.No_Ada_Node,
190190
Children => <>)],
@@ -204,11 +204,11 @@ package body LSP.Ada_Document_Symbol is
204204
end if;
205205
end Create_Job;
206206

207-
---------------------
208-
-- Execute_Request --
209-
---------------------
207+
-------------------------
208+
-- Execute_Ada_Request --
209+
-------------------------
210210

211-
overriding procedure Execute_Request
211+
overriding procedure Execute_Ada_Request
212212
(Self : in out Flat_Document_Symbol_Job;
213213
Client :
214214
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -254,13 +254,13 @@ package body LSP.Ada_Document_Symbol is
254254
Free (Self.Cursor);
255255
Status := LSP.Server_Jobs.Done;
256256
end if;
257-
end Execute_Request;
257+
end Execute_Ada_Request;
258258

259-
---------------------
260-
-- Execute_Request --
261-
---------------------
259+
-------------------------
260+
-- Execute_Ada_Request --
261+
-------------------------
262262

263-
overriding procedure Execute_Request
263+
overriding procedure Execute_Ada_Request
264264
(Self : in out Full_Document_Symbol_Job;
265265
Client :
266266
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -583,7 +583,7 @@ package body LSP.Ada_Document_Symbol is
583583
Variant_2 => Self.Stack.Last_Element.Children));
584584
Status := LSP.Server_Jobs.Done;
585585
end if;
586-
end Execute_Request;
586+
end Execute_Ada_Request;
587587

588588
-----------------
589589
-- Get_Profile --

source/ada/lsp-ada_empty_handlers.ads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ with LSP.Server_Request_Receivers;
2222
with LSP.Structures;
2323

2424
package LSP.Ada_Empty_Handlers is
25+
pragma Preelaborate;
2526

2627
type Empty_Message_Handler
2728
(Sender : not null access LSP.Client_Message_Receivers

source/ada/lsp-ada_folding_range.adb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ with Libadalang.Iterators;
2626
with VSS.Strings;
2727

2828
with LSP.Ada_Context_Sets;
29+
with LSP.Ada_Request_Jobs;
2930
with LSP.Client_Message_Receivers;
3031
with LSP.Constants;
31-
with LSP.Server_Request_Jobs;
3232
with LSP.Server_Requests.FoldingRange;
3333
with LSP.Structures;
3434

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

4343
type Folding_Range_Job
4444
(Parent : not null access constant Ada_Folding_Range_Handler) is limited
45-
new LSP.Server_Request_Jobs.Server_Request_Job
45+
new LSP.Ada_Request_Jobs.Ada_Request_Job
4646
(Priority => LSP.Server_Jobs.Low)
4747
with record
4848
Lines_Only : Boolean;
@@ -51,7 +51,7 @@ package body LSP.Ada_Folding_Range is
5151
Response : LSP.Structures.FoldingRange_Vector;
5252
end record;
5353

54-
overriding procedure Execute_Request
54+
overriding procedure Execute_Ada_Request
5555
(Self : in out Folding_Range_Job;
5656
Client :
5757
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -245,7 +245,7 @@ package body LSP.Ada_Folding_Range is
245245
Job : constant LSP.Server_Jobs.Server_Job_Access :=
246246
new Folding_Range_Job'
247247
(Parent => Self'Unchecked_Access,
248-
Request => LSP.Server_Request_Jobs.Request_Access (Message),
248+
Request => LSP.Ada_Request_Jobs.Request_Access (Message),
249249
Unit => Unit,
250250
Cursor => new Libadalang.Iterators.Traverse_Iterator'Class'
251251
(Libadalang.Iterators.Traverse (Unit.Root)),
@@ -255,11 +255,11 @@ package body LSP.Ada_Folding_Range is
255255
return Job;
256256
end Create_Job;
257257

258-
---------------------
259-
-- Execute_Request --
260-
---------------------
258+
-------------------------
259+
-- Execute_Ada_Request --
260+
-------------------------
261261

262-
overriding procedure Execute_Request
262+
overriding procedure Execute_Ada_Request
263263
(Self : in out Folding_Range_Job;
264264
Client :
265265
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -292,5 +292,5 @@ package body LSP.Ada_Folding_Range is
292292
end;
293293
end if;
294294
end loop;
295-
end Execute_Request;
295+
end Execute_Ada_Request;
296296
end LSP.Ada_Folding_Range;

source/ada/lsp-ada_hover.adb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ with VSS.Strings;
2323

2424
with LSP.Ada_Context_Sets;
2525
with LSP.Ada_Documentation;
26+
with LSP.Ada_Request_Jobs;
2627
with LSP.Client_Message_Receivers;
2728
with LSP.Predefined_Completion;
28-
with LSP.Server_Request_Jobs;
2929
with LSP.Server_Requests.Hover;
3030
with LSP.Structures;
3131
with LSP.Utils;
@@ -34,13 +34,13 @@ package body LSP.Ada_Hover is
3434

3535
type Ada_Hover_Job
3636
(Parent : not null access constant Ada_Hover_Handler) is limited
37-
new LSP.Server_Request_Jobs.Server_Request_Job
37+
new LSP.Ada_Request_Jobs.Ada_Request_Job
3838
(Priority => LSP.Server_Jobs.High)
3939
with null record;
4040

4141
type Ada_Hover_Job_Access is access all Ada_Hover_Job;
4242

43-
overriding procedure Execute_Request
43+
overriding procedure Execute_Ada_Request
4444
(Self : in out Ada_Hover_Job;
4545
Client :
4646
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -58,16 +58,16 @@ package body LSP.Ada_Hover is
5858
Result : constant Ada_Hover_Job_Access :=
5959
new Ada_Hover_Job'
6060
(Parent => Self'Unchecked_Access,
61-
Request => LSP.Server_Request_Jobs.Request_Access (Message));
61+
Request => LSP.Ada_Request_Jobs.Request_Access (Message));
6262
begin
6363
return LSP.Server_Jobs.Server_Job_Access (Result);
6464
end Create_Job;
6565

66-
---------------------
67-
-- Execute_Request --
68-
---------------------
66+
-------------------------
67+
-- Execute_Ada_Request --
68+
-------------------------
6969

70-
overriding procedure Execute_Request
70+
overriding procedure Execute_Ada_Request
7171
(Self : in out Ada_Hover_Job;
7272
Client :
7373
in out LSP.Client_Message_Receivers.Client_Message_Receiver'Class;
@@ -203,6 +203,6 @@ package body LSP.Ada_Hover is
203203
end if;
204204

205205
Client.On_Hover_Response (Message.Id, Response);
206-
end Execute_Request;
206+
end Execute_Ada_Request;
207207

208208
end LSP.Ada_Hover;

0 commit comments

Comments
 (0)