@@ -47,7 +47,6 @@ with LSP.Ada_Documents.LAL_Diagnostics;
47
47
with LSP.Common ; use LSP.Common;
48
48
with LSP.Lal_Utils ;
49
49
50
- with Pp.Actions ;
51
50
with Pp.Scanner ;
52
51
53
52
with Utils.Char_Vectors ;
@@ -1122,7 +1121,6 @@ package body LSP.Ada_Documents is
1122
1121
end loop ;
1123
1122
end Append_PP_Messages ;
1124
1123
1125
- Input : Char_Vector;
1126
1124
Output : Char_Vector;
1127
1125
1128
1126
PP_Messages : Pp.Scanner.Source_Message_Vector;
@@ -1139,52 +1137,22 @@ package body LSP.Ada_Documents is
1139
1137
1140
1138
Unit : constant Analysis_Unit :=
1141
1139
Self.Unit (Context);
1142
- Start_Node, End_Node : Ada_Node;
1143
1140
Enclosing_Node : Ada_Node;
1144
1141
1145
- Offset : Natural := 0 ;
1146
-
1147
1142
begin
1148
1143
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" );
1180
1145
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
+
1188
1156
exception
1189
1157
when others =>
1190
1158
Append_PP_Messages (PP_Messages);
0 commit comments