File tree Expand file tree Collapse file tree 2 files changed +14
-16
lines changed
testsuite/ada_lsp/T527-019.range_formatting Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ package body LSP.Ada_Handlers is
119119
120120 Partial_GNATpp : constant GNATCOLL.Traces.Trace_Handle :=
121121 GNATCOLL.Traces.Create (" ALS.PARTIAL_GNATPP" ,
122- GNATCOLL.Traces.Off );
122+ GNATCOLL.Traces.On );
123123 -- Use partial formatting mode of gnatpp if On. Otherwise, use diff
124124 -- algorithm.
125125
@@ -953,20 +953,18 @@ package body LSP.Ada_Handlers is
953953 Response.result.capabilities.documentFormattingProvider :=
954954 (Is_Set => True,
955955 Value => (workDoneProgress => LSP.Types.None));
956+ if Partial_GNATpp.Is_Active then
957+ Response.result.capabilities.documentRangeFormattingProvider :=
958+ (Is_Set => True,
959+ Value => (workDoneProgress => LSP.Types.None));
960+ end if ;
956961 Response.result.capabilities.callHierarchyProvider :=
957962 (Is_Set => True,
958963 Value => (Is_Boolean => False, Options => <>));
959964 Response.result.capabilities.documentHighlightProvider :=
960965 (Is_Set => True,
961966 Value => (workDoneProgress => LSP.Types.None));
962967
963- -- lalpp does not support range formatting for now
964- -- do not set the option
965- --
966- -- Response.result.capabilities.documentRangeFormattingProvider :=
967- -- (Is_Set => True,
968- -- Value => (workDoneProgress => LSP.Types.None));
969-
970968 Response.result.capabilities.workspaceSymbolProvider :=
971969 (Is_Set => True,
972970 Value => (workDoneProgress => LSP.Types.None));
Original file line number Diff line number Diff line change 134134 {
135135 "range" : {
136136 "start" : {
137- "line" : 2 ,
137+ "line" : 0 ,
138138 "character" : 0
139139 },
140140 "end" : {
141- "line" : 7 ,
142- "character" : 0
141+ "line" : 8 ,
142+ "character" : 9
143143 }
144144 },
145- "newText" : " X : Integer := (1 + 2 + 3);\n begin\n -- Insert code here.\n "
145+ "newText" : " procedure Main is \n -- comment \n X : Integer := (1 + 2 + 3);\n begin\n -- Insert code here.\n null; \n end Main; "
146146 }
147147 ]
148148 }
269269 {
270270 "range" : {
271271 "start" : {
272- "line" : 4 ,
272+ "line" : 0 ,
273273 "character" : 0
274274 },
275275 "end" : {
276- "line" : 5 ,
277- "character" : 0
276+ "line" : 6 ,
277+ "character" : 9
278278 }
279279 },
280- "newText" : " -- Insert code here.\n "
280+ "newText" : " procedure Main is \n -- comment \n X : Integer := (1 + 2 + 3); \n begin \n -- Insert code here.\n null; \n end Main; "
281281 }
282282 ]
283283 }
You can’t perform that action at this time.
0 commit comments