Skip to content

Commit fe8d801

Browse files
committed
Merge branch 'gnatstudio_389' into 'master'
Expand SemanticTokenModifiers enumeration type See merge request eng/ide/ada_language_server!2104
2 parents 92ab5c5 + 9a63606 commit fe8d801

File tree

7 files changed

+64
-4
lines changed

7 files changed

+64
-4
lines changed

doc/metaModel.patch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,23 @@
129129
"value": 3
130130
}
131131
]
132+
},
133+
{
134+
"name": "SemanticTokenModifiers",
135+
"type": {
136+
"kind": "base",
137+
"name": "string"
138+
},
139+
"values": [
140+
{
141+
"name": "globalVariable",
142+
"value": "globalVariable"
143+
},
144+
{
145+
"name": "localVariable",
146+
"value": "localVariable"
147+
}
148+
]
132149
}
133150
],
134151
"structures": [

liblsp_3_16/source/generated/lsp-message_io.adb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,6 +3529,10 @@ package body LSP.Message_IO is
35293529
V := documentation;
35303530
elsif Text = "defaultLibrary" then
35313531
V := defaultLibrary;
3532+
elsif Text = "globalVariable" then
3533+
V := globalVariable;
3534+
elsif Text = "localVariable" then
3535+
V := localVariable;
35323536
else
35333537
V := SemanticTokenModifiers'First;
35343538
end if;
@@ -3570,6 +3574,10 @@ package body LSP.Message_IO is
35703574
return "documentation";
35713575
when defaultLibrary =>
35723576
return "defaultLibrary";
3577+
when globalVariable =>
3578+
return "globalVariable";
3579+
when localVariable =>
3580+
return "localVariable";
35733581
end case;
35743582
end To_Virtual_String;
35753583

liblsp_3_16/source/lsp-messages.ads

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3853,7 +3853,9 @@ package LSP.Messages is
38533853
async,
38543854
modification,
38553855
documentation,
3856-
defaultLibrary);
3856+
defaultLibrary,
3857+
globalVariable,
3858+
localVariable);
38573859

38583860
procedure Read_SemanticTokenModifiers
38593861
(S : access Ada.Streams.Root_Stream_Type'Class;

liblsp_3_17/source/generated/lsp-enumerations.ads

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,8 @@ package LSP.Enumerations is
450450

451451
type SemanticTokenModifiers is
452452
(declaration, definition, readonly, static, deprecated, an_abstract,
453-
async, modification, documentation, defaultLibrary);
453+
async, modification, documentation, defaultLibrary, globalVariable,
454+
localVariable);
454455
-- A set of predefined token modifiers. This set is not fixed an clients
455456
-- can specify additional token types via the corresponding client
456457
-- capabilities.

liblsp_3_17/source/generated/lsp-inputs-part_17.adb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ package body LSP.Inputs.Part_17 is
4747
"async",
4848
"modification",
4949
"documentation",
50-
"defaultLibrary"]);
50+
"defaultLibrary",
51+
"globalVariable",
52+
"localVariable"]);
5153

5254
procedure Read_SemanticTokenModifiers
5355
(Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class;

liblsp_3_17/source/generated/lsp-outputs.adb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,10 @@ package body LSP.Outputs is
19881988
Handler.String_Value ("documentation");
19891989
when LSP.Enumerations.defaultLibrary =>
19901990
Handler.String_Value ("defaultLibrary");
1991+
when LSP.Enumerations.globalVariable =>
1992+
Handler.String_Value ("globalVariable");
1993+
when LSP.Enumerations.localVariable =>
1994+
Handler.String_Value ("localVariable");
19911995
end case;
19921996
end Write_SemanticTokenModifiers;
19931997

source/lsp_gen/lsp_gen-meta_models.adb

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,34 @@ package body LSP_Gen.Meta_Models is
6969
declare
7070
Item : constant LSP_Gen.Entities.Enumeration :=
7171
Patch.enumerations (J);
72+
Append : Boolean := True;
7273
begin
73-
Self.Model.enumerations.Append (Item);
74+
for I in 1 .. Self.Model.enumerations.Length loop
75+
declare
76+
Ref : constant LSP_Gen.Entities.
77+
Enumeration_Variable_Reference :=
78+
Self.Model.enumerations.
79+
Get_Enumeration_Variable_Reference (I);
80+
begin
81+
if Ref.name = Item.name then
82+
-- we already have the enum, this means we would like to
83+
-- expand their values
84+
Append := False;
85+
86+
for I in 1 .. Item.values.Length loop
87+
Ref.values.Append
88+
(Item.values.
89+
Get_EnumerationEntry_Constant_Reference (I));
90+
end loop;
91+
92+
exit;
93+
end if;
94+
end;
95+
end loop;
96+
97+
if Append then
98+
Self.Model.enumerations.Append (Item);
99+
end if;
74100
end;
75101
end loop;
76102

0 commit comments

Comments
 (0)