@@ -47,7 +47,6 @@ with LSP.Ada_Documents.LAL_Diagnostics;
4747with LSP.Common ; use LSP.Common;
4848with LSP.Lal_Utils ;
4949
50- with Pp.Actions ;
5150with Pp.Scanner ;
5251
5352with Utils.Char_Vectors ;
@@ -1122,7 +1121,6 @@ package body LSP.Ada_Documents is
11221121 end loop ;
11231122 end Append_PP_Messages ;
11241123
1125- Input : Char_Vector;
11261124 Output : Char_Vector;
11271125
11281126 PP_Messages : Pp.Scanner.Source_Message_Vector;
@@ -1139,52 +1137,22 @@ package body LSP.Ada_Documents is
11391137
11401138 Unit : constant Analysis_Unit :=
11411139 Self.Unit (Context);
1142- Start_Node, End_Node : Ada_Node;
11431140 Enclosing_Node : Ada_Node;
11441141
1145- Offset : Natural := 0 ;
1146-
11471142 begin
11481143 Context.Trace.Trace (" On Range_Formatting" );
1149-
1150- Context.Trace.Trace (" Get_Selected_Region_Enclosing_Node" );
1151- Get_Selected_Region_Enclosing_Node
1152- (Unit => Unit,
1153- SL_Range => Input_Selection_Range,
1154- Start_Node => Start_Node,
1155- End_Node => End_Node,
1156- Enclosing_Node => Enclosing_Node,
1157- Input_Sel => Input,
1158- Output_Sel_Range => Output_Selection_Range);
1159- Context.Trace.Trace (" Start_Node: " & Start_Node.Image);
1160- Context.Trace.Trace (" End_Node: " & End_Node.Image);
1161- Context.Trace.Trace (" Enclosing_Node: " & Enclosing_Node.Image);
1162- Context.Trace.Trace
1163- (" Output_Selection_Range: " & Image (Output_Selection_Range));
1164-
1165- Context.Trace.Trace
1166- (" Get_Starting_Offset and Set_Partial_Gnatpp_Offset" );
1167- Offset :=
1168- Get_Starting_Offset
1169- (Node => Enclosing_Node,
1170- PP_Indent =>
1171- Pp.Command_Lines.PP_Indentation (PP_Options),
1172- PP_Indent_Continuation =>
1173- Pp.Command_Lines.PP_Indent_Continuation (PP_Options));
1174- Context.Trace.Trace (Offset'Image);
1175- if Offset /= 0 then
1176- Pp.Actions.Set_Partial_Gnatpp_Offset (Offset - 1 );
1177- end if ;
1178-
1179- Context.Trace.Trace (" Format_Vector" );
1144+ Context.Trace.Trace (" Format_Selection" );
11801145 begin
1181- Pp.Actions.Format_Vector
1182- (Cmd => PP_Options,
1183- Input => Input,
1184- Node => Enclosing_Node,
1185- Output => Output,
1186- Messages => PP_Messages,
1187- Partial_Gnatpp => True);
1146+ Format_Selection
1147+ (Main_Unit => Unit,
1148+ Input_Selection_Range => Input_Selection_Range,
1149+ Output => Output,
1150+ Output_Selection_Range => Output_Selection_Range,
1151+ PP_Messages => PP_Messages,
1152+ Formatted_Node => Enclosing_Node,
1153+ PP_Options => PP_Options,
1154+ Force_Source_Line_Breaks => False);
1155+
11881156 exception
11891157 when others =>
11901158 Append_PP_Messages (PP_Messages);
0 commit comments