Skip to content

Commit 2a657e0

Browse files
committed
Add a simple test for inlineValue request
1 parent cc53306 commit 2a657e0

File tree

4 files changed

+177
-0
lines changed

4 files changed

+177
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ section below it for the last release. -->
66
## \<next>
77

88
* Added `onEnterRules` for Ada/GPR files to split long comments by adding automatically a comment tag to the next line
9+
* Added support for new LSP request `textDocument/inlineValue`
910

1011
## 26.0.202504171
1112

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
procedure Iv_Test is
2+
S : constant String := "abc";
3+
X : constant := 23;
4+
Y : constant Integer := S'Length;
5+
Z : Integer := X + Y;
6+
7+
begin
8+
while Z > 0 loop
9+
Z := Z - 10;
10+
end loop;
11+
end Iv_Test;
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
[
2+
{
3+
"comment": ["This test checks inline_value request"]
4+
},
5+
{
6+
"start": {
7+
"cmd": ["${ALS}"]
8+
}
9+
},
10+
{
11+
"send": {
12+
"request": {
13+
"jsonrpc": "2.0",
14+
"id": 0,
15+
"method": "initialize",
16+
"params": {
17+
"processId": 1,
18+
"rootUri": "$URI{.}",
19+
"capabilities": {}
20+
}
21+
},
22+
"wait": [
23+
{
24+
"id": 0,
25+
"result": {
26+
"capabilities": {
27+
"textDocumentSync": 2,
28+
"inlineValueProvider": true
29+
}
30+
}
31+
}
32+
]
33+
}
34+
},
35+
{
36+
"send": {
37+
"request": {
38+
"jsonrpc": "2.0",
39+
"method": "workspace/didChangeConfiguration",
40+
"params": {
41+
"settings": {}
42+
}
43+
},
44+
"wait": []
45+
}
46+
},
47+
{
48+
"send": {
49+
"request": {
50+
"jsonrpc": "2.0",
51+
"method": "textDocument/didOpen",
52+
"params": {
53+
"textDocument": {
54+
"uri": "$URI{iv_test.adb}",
55+
"languageId": "ada",
56+
"version": 1,
57+
"text": "procedure Iv_Test is\n S : constant String := \"abc\";\n X : constant := 23;\n Y : constant Integer := S'Length;\n Z : Integer := X + Y;\n\nbegin\n while Z > 0 loop\n Z := Z - 10;\n end loop;\nend Iv_Test;\n"
58+
}
59+
}
60+
},
61+
"wait": []
62+
}
63+
},
64+
{
65+
"send": {
66+
"request": {
67+
"jsonrpc": "2.0",
68+
"id": "iv-1",
69+
"method": "textDocument/inlineValue",
70+
"params": {
71+
"textDocument": { "uri": "$URI{iv_test.adb}" },
72+
"range": {
73+
"start": { "line": 0, "character": 0 },
74+
"end": { "line": 11, "character": 0 }
75+
},
76+
"context": {
77+
"frameId": 1000,
78+
"stoppedLocation": {
79+
"start": { "line": 8, "character": 1 },
80+
"end": { "line": 8, "character": 1 }
81+
}
82+
}
83+
}
84+
},
85+
"wait": [
86+
{
87+
"id": "iv-1",
88+
"result": [
89+
{
90+
"range": {
91+
"start": { "line": 3, "character": 27 },
92+
"end": { "line": 3, "character": 28 }
93+
},
94+
"text": "S = abc"
95+
},
96+
{
97+
"range": {
98+
"start": { "line": 4, "character": 18 },
99+
"end": { "line": 4, "character": 19 }
100+
},
101+
"text": "X = 23"
102+
},
103+
{
104+
"range": {
105+
"start": { "line": 4, "character": 22 },
106+
"end": { "line": 4, "character": 23 }
107+
},
108+
"text": "Y = 3"
109+
},
110+
{
111+
"range": {
112+
"start": { "line": 7, "character": 9 },
113+
"end": { "line": 7, "character": 10 }
114+
},
115+
"caseSensitiveLookup": false
116+
},
117+
{
118+
"range": {
119+
"start": { "line": 8, "character": 6 },
120+
"end": { "line": 8, "character": 7 }
121+
},
122+
"caseSensitiveLookup": false
123+
},
124+
{
125+
"range": {
126+
"start": { "line": 8, "character": 11 },
127+
"end": { "line": 8, "character": 12 }
128+
},
129+
"caseSensitiveLookup": false
130+
},
131+
{
132+
"range": {
133+
"start": { "line": 8, "character": 11 },
134+
"end": { "line": 8, "character": 17 }
135+
}
136+
}
137+
]
138+
}
139+
]
140+
}
141+
},
142+
{
143+
"send": {
144+
"request": {
145+
"jsonrpc": "2.0",
146+
"id": "shutdown",
147+
"method": "shutdown",
148+
"params": null
149+
},
150+
"wait": [{ "id": "shutdown", "result": null }]
151+
}
152+
},
153+
{
154+
"send": {
155+
"request": { "jsonrpc": "2.0", "method": "exit" },
156+
"wait": []
157+
}
158+
},
159+
{
160+
"stop": {
161+
"exit_code": 0
162+
}
163+
}
164+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: 'inline_values'

0 commit comments

Comments
 (0)