Skip to content

Commit f93a19c

Browse files
Fix CompletionItem.data type
The LSP 3.17 spec declares it as an optional LSP_Any field. This caused issues with GNAT Studio when trytong to parse GLS completion responses. For eng/ide/gnatstudio#141
1 parent feba33a commit f93a19c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

source/gpr/lsp-gpr_completions.adb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ package body LSP.GPR_Completions is
268268
end Fill_Completion_Response;
269269

270270
procedure Fill_Completion_Resolve_Response
271-
(Response : in out LSP.Structures.CompletionItem) is
271+
(Response : in out LSP.Structures.CompletionItem)
272+
is
272273
Pack : Package_Id;
273274
Attr : Q_Optional_Attribute_Id;
274275
Doc_Text : VSS.Strings.Virtual_String;

source/protocol/generated/lsp-message_io.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7080,7 +7080,7 @@ package body LSP.Message_IO is
70807080
elsif Key = "command" then
70817081
Optional_Command'Read (S, V.command);
70827082
elsif Key = "data" then
7083-
Optional_Location'Read (S, V.data);
7083+
Optional_LSP_Any'Read (S, V.data);
70847084
else
70857085
JS.Skip_Value;
70867086
end if;
@@ -7130,7 +7130,7 @@ package body LSP.Message_IO is
71307130
JS.Key ("command");
71317131
Optional_Command'Write (S, V.command);
71327132
JS.Key ("data");
7133-
Optional_Location'Write (S, V.data);
7133+
Optional_LSP_Any'Write (S, V.data);
71347134
JS.End_Object;
71357135
end Write_CompletionItem;
71367136

source/protocol/lsp-messages.ads

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7625,7 +7625,7 @@ package LSP.Messages is
76257625
additionalTextEdits : TextEdit_Vector;
76267626
commitCharacters : Optional_Virtual_String_Vector;
76277627
command : Optional_Command;
7628-
data : Optional_Location;
7628+
data : Optional_LSP_Any;
76297629
end record;
76307630

76317631
procedure Read_CompletionItem

0 commit comments

Comments
 (0)