Skip to content

Commit 7a3a356

Browse files
committed
Add test case for GPR semantic tokens request
1 parent ad94ba8 commit 7a3a356

File tree

5 files changed

+475
-0
lines changed

5 files changed

+475
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
abstract project Config is
2+
Flag := "-g";
3+
end Config;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
with "config.gpr";
2+
abstract project Prj is
3+
type Enum is ("-O0", "-O3", "-g");
4+
Var : Enum := Config.Flag;
5+
6+
package Compiler is
7+
for Switches ("Ada") use (Config.Flag);
8+
end Compiler;
9+
10+
Var := "-O3";
11+
end Prj;
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
[
2+
{
3+
"comment": [
4+
"test for textDocument/semanticTokens/full"
5+
]
6+
},
7+
{
8+
"start": {
9+
"cmd": [
10+
"${ALS}",
11+
"--language-gpr"
12+
]
13+
}
14+
},
15+
{
16+
"send": {
17+
"request": {
18+
"jsonrpc": "2.0",
19+
"id": "init",
20+
"method": "initialize",
21+
"params": {
22+
"processId": 441587,
23+
"rootUri": "$URI{.}",
24+
"capabilities": {
25+
"workspace": {
26+
"applyEdit": true,
27+
"workspaceEdit": {},
28+
"didChangeConfiguration": {},
29+
"didChangeWatchedFiles": {},
30+
"executeCommand": {}
31+
},
32+
"textDocument": {
33+
"synchronization": {},
34+
"completion": {
35+
"dynamicRegistration": true,
36+
"completionItem": {
37+
"snippetSupport": true,
38+
"documentationFormat": [
39+
"plaintext",
40+
"markdown"
41+
]
42+
}
43+
},
44+
"hover": {},
45+
"signatureHelp": {},
46+
"declaration": {},
47+
"definition": {},
48+
"typeDefinition": {},
49+
"implementation": {},
50+
"references": {},
51+
"documentHighlight": {},
52+
"documentSymbol": {
53+
"hierarchicalDocumentSymbolSupport": true
54+
},
55+
"codeLens": {},
56+
"colorProvider": {},
57+
"formatting": {
58+
"dynamicRegistration": false
59+
},
60+
"rangeFormatting": {
61+
"dynamicRegistration": false
62+
},
63+
"onTypeFormatting": {
64+
"dynamicRegistration": false
65+
},
66+
"foldingRange": {
67+
"lineFoldingOnly": true
68+
},
69+
"selectionRange": {},
70+
"linkedEditingRange": {},
71+
"callHierarchy": {},
72+
"semanticTokens": {
73+
"dynamicRegistration": true,
74+
"tokenTypes": [
75+
"namespace",
76+
"type",
77+
"class",
78+
"enum",
79+
"interface",
80+
"struct",
81+
"typeParameter",
82+
"parameter",
83+
"variable",
84+
"property",
85+
"enumMember",
86+
"event",
87+
"function",
88+
"method",
89+
"macro",
90+
"keyword",
91+
"modifier",
92+
"comment",
93+
"string",
94+
"number",
95+
"regexp",
96+
"operator",
97+
"decorator"
98+
],
99+
"tokenModifiers": [
100+
"declaration",
101+
"definition",
102+
"readonly",
103+
"static",
104+
"deprecated",
105+
"abstract",
106+
"async",
107+
"modification",
108+
"documentation",
109+
"defaultLibrary"
110+
],
111+
"formats": ["relative"],
112+
"requests": { "range": true, "full": { "delta": true } },
113+
"multilineTokenSupport": false,
114+
"overlappingTokenSupport": false,
115+
"serverCancelSupport": true,
116+
"augmentsSyntaxTokens": true
117+
}
118+
}
119+
}
120+
}
121+
},
122+
"wait": [
123+
{
124+
"jsonrpc": "2.0",
125+
"id": "init",
126+
"result": {
127+
"capabilities": {
128+
"textDocumentSync": {
129+
"openClose": true,
130+
"change": 1
131+
},
132+
"semanticTokensProvider": {
133+
"legend": {
134+
"tokenTypes": ["namespace", "enum", "variable", "property"],
135+
"tokenModifiers": ["declaration", "modification"]
136+
},
137+
"full": true
138+
}
139+
}
140+
}
141+
}
142+
]
143+
}
144+
},
145+
{
146+
"send": {
147+
"request": {
148+
"jsonrpc": "2.0",
149+
"method": "initialized"
150+
},
151+
"wait": []
152+
}
153+
},
154+
{
155+
"send": {
156+
"request": {
157+
"jsonrpc": "2.0",
158+
"method": "textDocument/didOpen",
159+
"params": {
160+
"textDocument": {
161+
"uri": "$URI{prj.gpr}",
162+
"languageId": "Gpr",
163+
"version": 1,
164+
"text": "with \"config.gpr\";\nabstract project Prj is\n type Enum is (\"-O0\", \"-O3\", \"-g\");\n Var : Enum := Config.Flag;\n\n package Compiler is\n for Switches (\"Ada\") use (Config.Flag);\n end Compiler;\n\n Var := \"-O3\";\nend Prj;\n"
165+
}
166+
}
167+
},
168+
"wait": []
169+
}
170+
},
171+
{
172+
"send": {
173+
"request": {
174+
"params": {
175+
"textDocument": {
176+
"uri": "$URI{prj.gpr}"
177+
}
178+
},
179+
"jsonrpc": "2.0",
180+
"id": 1,
181+
"method": "textDocument/semanticTokens/full"
182+
},
183+
"wait": [
184+
{
185+
"id": 1,
186+
"result": {
187+
"data":[2,8,4,1,1,1,3,3,2,1,0,6,4,1,0,0,8,6,0,0,0,7,4,2,0,2,11,8,0,1,1,10,8,3,1,0,22,6,0,0,0,7,4,2,0,1,7,8,0,0,2,3,3,2,1,1,4,3,0,0]
188+
}
189+
}
190+
]
191+
}
192+
},
193+
{
194+
"send": {
195+
"request": {
196+
"jsonrpc": "2.0",
197+
"id": "shutdown",
198+
"method": "shutdown",
199+
"params": null
200+
},
201+
"wait": [
202+
{
203+
"id": "shutdown",
204+
"result": null
205+
}
206+
]
207+
}
208+
},
209+
{
210+
"send": {
211+
"request": {
212+
"jsonrpc": "2.0",
213+
"method": "exit"
214+
},
215+
"wait": []
216+
}
217+
},
218+
{
219+
"stop": {
220+
"exit_code": 0
221+
}
222+
}
223+
]

0 commit comments

Comments
 (0)