Skip to content

Commit fd80019

Browse files
committed
VB25-013 Add the test case
1 parent da211da commit fd80019

File tree

10 files changed

+277
-0
lines changed

10 files changed

+277
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
project Base is
2+
for Source_Dirs use (".");
3+
end Base;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import os
2+
import os.path
3+
import sys
4+
5+
dir=os.path.dirname(sys.argv[0])
6+
gpr=os.path.join (dir, 'subproject.gpr')
7+
os.rename(gpr, gpr + '.old')
8+
os.rename(gpr + '.fixed', gpr)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
with "subproject.gpr";
2+
3+
project Choices is
4+
for Source_Dirs use ("choices");
5+
end Choices;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
with To_Be_Called;
2+
procedure Second is
3+
begin
4+
To_Be_Called;
5+
end Second;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
with "base";
2+
project Subproject is
3+
for Source_Dirs use (
4+
-- "subproject" -- Uncomment this and reload project
5+
);
6+
end Subproject;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
with "base";
2+
project Subproject is
3+
for Source_Dirs use (
4+
"subproject" -- Uncomment this and reload project
5+
);
6+
end Subproject;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
with To_Be_Called;
2+
procedure Third is
3+
begin
4+
To_Be_Called;
5+
end Third;
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
[
2+
{
3+
"comment":[
4+
"Do FindAllReferenfes, then change subproject, run command `als-reload-project` and do it again."
5+
]
6+
}, {
7+
"start": {
8+
"cmd": ["${ALS}"]
9+
}
10+
}, {
11+
"send": {
12+
"request": {"jsonrpc":"2.0","id":0,"method":"initialize","params":{
13+
"processId":1,
14+
"rootUri":"$URI{.}",
15+
"capabilities":{}}
16+
},
17+
"wait":[{
18+
"id": 0,
19+
"result":{
20+
"capabilities":{
21+
"textDocumentSync": 2,
22+
"executeCommandProvider": {
23+
"commands": [
24+
"<HAS>",
25+
"als-reload-project"
26+
]
27+
},
28+
"referencesProvider":true
29+
}
30+
}
31+
}]
32+
}
33+
}, {
34+
"send": {
35+
"request": {
36+
"jsonrpc":"2.0",
37+
"method":"workspace/didChangeConfiguration",
38+
"params":{
39+
"settings":{
40+
"ada": {
41+
"projectFile": "choices.gpr"
42+
}
43+
}
44+
}
45+
},
46+
"wait":[]
47+
}
48+
}, {
49+
"send": {
50+
"request": {
51+
"jsonrpc":"2.0",
52+
"method":"textDocument/didOpen",
53+
"params":{
54+
"textDocument": {
55+
"uri": "$URI{to_be_called.adb}",
56+
"languageId": "ada",
57+
"version": 1,
58+
"text": "procedure To_Be_Called is\nbegin\n null;\nend To_Be_Called;\n"
59+
}
60+
}
61+
},
62+
"wait":[]
63+
}
64+
}, {
65+
"send": {
66+
"request": {
67+
"jsonrpc":"2.0",
68+
"id":"references-1",
69+
"method":"textDocument/references",
70+
"params":{
71+
"textDocument": {
72+
"uri": "$URI{to_be_called.adb}"
73+
},
74+
"position": {
75+
"line": 0,
76+
"character": 15
77+
},
78+
"context": {
79+
"includeDeclaration":false
80+
}
81+
}
82+
},
83+
"sortReply": { "result": "uri" },
84+
"wait":[{
85+
"id": "references-1",
86+
"result":[{
87+
"uri": "$URI{choices/second.adb}",
88+
"range": {
89+
"start": {
90+
"line": 0,
91+
"character": 5
92+
},
93+
"end": {
94+
"line": 0,
95+
"character": 17
96+
}
97+
},
98+
"alsKind": ["reference"]
99+
}, {
100+
"uri": "$URI{choices/second.adb}",
101+
"range": {
102+
"start": {
103+
"line": 3,
104+
"character": 3
105+
},
106+
"end": {
107+
"line": 3,
108+
"character": 15
109+
}
110+
},
111+
"alsKind": ["call"]
112+
}]
113+
}]
114+
}
115+
}, {
116+
"shell": ["${PYTHON}", "${DIR}/change_project.py" ]
117+
}, {
118+
"send": {
119+
"request": {
120+
"jsonrpc":"2.0",
121+
"id":"sw1",
122+
"method":"workspace/executeCommand",
123+
"params":{
124+
"command": "als-reload-project",
125+
"arguments": [
126+
]
127+
}
128+
},
129+
"wait":[
130+
{
131+
"jsonrpc": "2.0",
132+
"id": "sw1",
133+
"result": null
134+
}
135+
]
136+
}
137+
}, {
138+
"send": {
139+
"request": {
140+
"jsonrpc":"2.0",
141+
"id":"references-2",
142+
"method":"textDocument/references",
143+
"params":{
144+
"textDocument": {
145+
"uri": "$URI{to_be_called.adb}"
146+
},
147+
"position": {
148+
"line": 0,
149+
"character": 15
150+
},
151+
"context": {
152+
"includeDeclaration":false
153+
}
154+
}
155+
},
156+
"sortReply": { "result": "uri" },
157+
"wait":[{
158+
"id": "references-2",
159+
"result":[{
160+
"uri": "$URI{choices/second.adb}",
161+
"range": {
162+
"start": {
163+
"line": 0,
164+
"character": 5
165+
},
166+
"end": {
167+
"line": 0,
168+
"character": 17
169+
}
170+
},
171+
"alsKind": ["reference"]
172+
}, {
173+
"uri": "$URI{choices/second.adb}",
174+
"range": {
175+
"start": {
176+
"line": 3,
177+
"character": 3
178+
},
179+
"end": {
180+
"line": 3,
181+
"character": 15
182+
}
183+
},
184+
"alsKind": ["call"]
185+
}, {
186+
"uri": "$URI{subproject/third.adb}",
187+
"range": {
188+
"start": {
189+
"line": 0,
190+
"character": 5
191+
},
192+
"end": {
193+
"line": 0,
194+
"character": 17
195+
}
196+
},
197+
"alsKind": ["reference"]
198+
}, {
199+
"uri": "$URI{subproject/third.adb}",
200+
"range": {
201+
"start": {
202+
"line": 3,
203+
"character": 3
204+
},
205+
"end": {
206+
"line": 3,
207+
"character": 15
208+
}
209+
},
210+
"alsKind": ["call"]
211+
}]
212+
}]
213+
}
214+
}, {
215+
"send": {
216+
"request": {
217+
"jsonrpc":"2.0",
218+
"id": "shutdown",
219+
"method":"shutdown",
220+
"params":null
221+
},
222+
"wait":[{ "id": "shutdown", "result": null }]
223+
}
224+
}, {
225+
"send": {
226+
"request": {"jsonrpc":"2.0", "method":"exit", "params":{}},
227+
"wait":[]
228+
}
229+
}, {
230+
"stop": {
231+
"exit_code": 0
232+
}
233+
}
234+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: 'project_reload.command'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
procedure To_Be_Called is
2+
begin
3+
null;
4+
end To_Be_Called;

0 commit comments

Comments
 (0)