Skip to content

Commit 50b29c2

Browse files
committed
Merge branch 'topic/vadim/lsp317-2' into 'master'
Port few patches from GS transition to LSP 3.17 See merge request eng/ide/ada_language_server!1770
2 parents 14af323 + 9f2188a commit 50b29c2

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
--
2+
-- Copyright (C) 2024, AdaCore
3+
--
4+
-- SPDX-License-Identifier: Apache-2.0
5+
--
6+
7+
with VSS.Strings;
8+
9+
procedure LSP.Inputs.Read_ResponseError
10+
(Stream : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class;
11+
Value : out LSP.Errors.ResponseError)
12+
is
13+
use type VSS.Strings.Virtual_String;
14+
15+
begin
16+
pragma Assert (Stream.Is_Start_Object);
17+
Stream.Read_Next;
18+
19+
while not Stream.Is_End_Object loop
20+
pragma Assert (Stream.Is_Key_Name);
21+
22+
declare
23+
Key : constant VSS.Strings.Virtual_String := Stream.Key_Name;
24+
25+
begin
26+
Stream.Read_Next;
27+
28+
if Key = "code" then
29+
LSP.Inputs.Read_ErrorCodes (Stream, Value.code);
30+
31+
elsif Key = "message" then
32+
Value.message := Stream.String_Value;
33+
Stream.Read_Next;
34+
35+
else
36+
Stream.Skip_Current_Value;
37+
end if;
38+
end;
39+
end loop;
40+
41+
Stream.Read_Next;
42+
end LSP.Inputs.Read_ResponseError;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--
2+
-- Copyright (C) 2024, AdaCore
3+
--
4+
-- SPDX-License-Identifier: Apache-2.0
5+
--
6+
7+
with VSS.JSON.Pull_Readers;
8+
with LSP.Errors;
9+
10+
procedure LSP.Inputs.Read_ResponseError
11+
(Stream : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class;
12+
Value : out LSP.Errors.ResponseError);

liblsp_3_17/source/lsp-structures-hashes.ads

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ package LSP.Structures.Hashes is
1212
(Item : LSP.Structures.Integer_Or_Virtual_String)
1313
return Ada.Containers.Hash_Type;
1414

15+
function Hash
16+
(Item : LSP.Structures.ProgressToken) return Ada.Containers.Hash_Type;
17+
1518
private
1619

1720
function Hash
@@ -21,4 +24,11 @@ private
2124
when True => Ada.Containers.Hash_Type'Mod (Item.Integer),
2225
when False => VSS.Strings.Hash (Item.Virtual_String));
2326

27+
function Hash
28+
(Item : LSP.Structures.ProgressToken)
29+
return Ada.Containers.Hash_Type is
30+
(case Item.Is_Integer is
31+
when True => Ada.Containers.Hash_Type'Mod (Item.Integer),
32+
when False => VSS.Strings.Hash (Item.Virtual_String));
33+
2434
end LSP.Structures.Hashes;

0 commit comments

Comments
 (0)