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 @@ -118,7 +118,7 @@ package body LSP.Ada_Handlers is
118118
119119 Partial_GNATpp : constant GNATCOLL.Traces.Trace_Handle :=
120120 GNATCOLL.Traces.Create (" ALS.PARTIAL_GNATPP" ,
121- GNATCOLL.Traces.Off );
121+ GNATCOLL.Traces.On );
122122 -- Use partial formatting mode of gnatpp if On. Otherwise, use diff
123123 -- algorithm.
124124
@@ -984,20 +984,18 @@ package body LSP.Ada_Handlers is
984984 Response.result.capabilities.documentFormattingProvider :=
985985 (Is_Set => True,
986986 Value => (workDoneProgress => LSP.Types.None));
987+ if Partial_GNATpp.Is_Active then
988+ Response.result.capabilities.documentRangeFormattingProvider :=
989+ (Is_Set => True,
990+ Value => (workDoneProgress => LSP.Types.None));
991+ end if ;
987992 Response.result.capabilities.callHierarchyProvider :=
988993 (Is_Set => True,
989994 Value => (Is_Boolean => False, Options => <>));
990995 Response.result.capabilities.documentHighlightProvider :=
991996 (Is_Set => True,
992997 Value => (workDoneProgress => LSP.Types.None));
993998
994- -- lalpp does not support range formatting for now
995- -- do not set the option
996- --
997- -- Response.result.capabilities.documentRangeFormattingProvider :=
998- -- (Is_Set => True,
999- -- Value => (workDoneProgress => LSP.Types.None));
1000-
1001999 Response.result.capabilities.workspaceSymbolProvider :=
10021000 (Is_Set => True,
10031001 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