Skip to content

Commit b90df0f

Browse files
BoulangerAdrienBoulanger
authored andcommitted
Add jobs for rangeFormatting and onTypeFormatting
It allows to control the priority of these requests Closes eng/ide/ada_language_server#1719
1 parent 19265fe commit b90df0f

File tree

6 files changed

+527
-342
lines changed

6 files changed

+527
-342
lines changed

source/ada/lsp-ada_driver.adb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ with LSP.Ada_Did_Change_Document;
5050
with LSP.Ada_Document_Symbol;
5151
with LSP.Ada_Execute_Command;
5252
with LSP.Ada_Folding_Range;
53+
with LSP.Ada_Formatter;
5354
with LSP.Ada_Handlers.Executables_Commands;
5455
with LSP.Ada_Handlers.GPR_Dependencies_Commands;
5556
with LSP.Ada_Handlers.Mains_Commands;
@@ -122,7 +123,9 @@ with LSP.Server_Requests.FoldingRange;
122123
with LSP.Server_Requests.Hover;
123124
with LSP.Server_Requests.Initialize;
124125
with LSP.Server_Requests.InlineValue;
126+
with LSP.Server_Requests.OnTypeFormatting;
125127
with LSP.Server_Requests.PrepareTypeHierarchy;
128+
with LSP.Server_Requests.RangeFormatting;
126129
with LSP.Server_Requests.References;
127130
with LSP.Server_Requests.SelectionRange;
128131
with LSP.Server_Requests.Subtypes;
@@ -310,6 +313,14 @@ procedure LSP.Ada_Driver is
310313
Ada_Hover_Handler : aliased LSP.Ada_Hover.Ada_Hover_Handler
311314
(Ada_Handler'Unchecked_Access);
312315

316+
Ada_Range_Formatter_Handler :
317+
aliased LSP.Ada_Formatter.Ada_Range_Formatter_Handler
318+
(Ada_Handler'Unchecked_Access);
319+
320+
Ada_On_Type_Formatter_Handler :
321+
aliased LSP.Ada_Formatter.Ada_On_Type_Formatter_Handler
322+
(Ada_Handler'Unchecked_Access);
323+
313324
Ada_Definition_Handler : aliased LSP.Ada_Definition.Ada_Definition_Handler
314325
(Ada_Handler'Unchecked_Access);
315326

@@ -702,6 +713,14 @@ begin
702713
(LSP.Server_Requests.Hover.Request'Tag,
703714
Ada_Hover_Handler'Unchecked_Access);
704715

716+
Server.Register_Handler
717+
(LSP.Server_Requests.RangeFormatting.Request'Tag,
718+
Ada_Range_Formatter_Handler'Unchecked_Access);
719+
720+
Server.Register_Handler
721+
(LSP.Server_Requests.OnTypeFormatting.Request'Tag,
722+
Ada_On_Type_Formatter_Handler'Unchecked_Access);
723+
705724
Server.Register_Handler
706725
(LSP.Server_Requests.Definition.Request'Tag,
707726
Ada_Definition_Handler'Unchecked_Access);

0 commit comments

Comments
 (0)