Skip to content

Commit 8106843

Browse files
committed
Add the testcase for checking if rename works
in an out of project file.
1 parent 079e922 commit 8106843

File tree

5 files changed

+169
-0
lines changed

5 files changed

+169
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
project Default is
2+
for Source_Dirs use ("src");
3+
end Default;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
procedure Proc is
2+
begin
3+
Proc;
4+
end Proc;
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
[
2+
{
3+
"comment": [
4+
"This test checks out-of-project file has GPR2 context by executing a rename request."
5+
]
6+
},
7+
{
8+
"start": {
9+
"cmd": ["${ALS}"]
10+
}
11+
},
12+
{
13+
"send": {
14+
"request": {
15+
"jsonrpc": "2.0",
16+
"id": 0,
17+
"method": "initialize",
18+
"params": {
19+
"processId": 1,
20+
"rootUri": "$URI{.}",
21+
"capabilities": {}
22+
}
23+
},
24+
"wait": [
25+
{
26+
"id": 0,
27+
"result": {
28+
"capabilities": {
29+
"textDocumentSync": 2,
30+
"renameProvider": {}
31+
}
32+
}
33+
}
34+
]
35+
}
36+
},
37+
{
38+
"send": {
39+
"request": {
40+
"jsonrpc": "2.0",
41+
"method": "workspace/didChangeConfiguration",
42+
"params": {
43+
"settings": {}
44+
}
45+
},
46+
"wait": []
47+
}
48+
},
49+
{
50+
"send": {
51+
"request": {
52+
"jsonrpc": "2.0",
53+
"method": "textDocument/didOpen",
54+
"params": {
55+
"textDocument": {
56+
"uri": "$URI{proc.adb}",
57+
"languageId": "ada",
58+
"version": 1,
59+
"text": "procedure Proc is\nbegin\n Proc;\nend Proc;\n"
60+
}
61+
}
62+
},
63+
"wait": []
64+
}
65+
},
66+
{
67+
"send": {
68+
"request": {
69+
"jsonrpc": "2.0",
70+
"id": "rename-1",
71+
"method": "textDocument/rename",
72+
"params": {
73+
"textDocument": {
74+
"uri": "$URI{proc.adb}"
75+
},
76+
"position": {
77+
"line": 0,
78+
"character": 11
79+
},
80+
"newName": "Proc2"
81+
}
82+
},
83+
"wait": [
84+
{
85+
"id": "rename-1",
86+
"result": {
87+
"changes": {
88+
"$URI{proc.adb}": [
89+
{
90+
"newText": "Proc2",
91+
"range": {
92+
"end": {
93+
"character": 14,
94+
"line": 0
95+
},
96+
"start": {
97+
"character": 10,
98+
"line": 0
99+
}
100+
}
101+
},
102+
{
103+
"newText": "Proc2",
104+
"range": {
105+
"end": {
106+
"character": 7,
107+
"line": 2
108+
},
109+
"start": {
110+
"character": 3,
111+
"line": 2
112+
}
113+
}
114+
},
115+
{
116+
"newText": "Proc2",
117+
"range": {
118+
"end": {
119+
"character": 8,
120+
"line": 3
121+
},
122+
"start": {
123+
"character": 4,
124+
"line": 3
125+
}
126+
}
127+
}
128+
]
129+
}
130+
}
131+
}
132+
]
133+
}
134+
},
135+
{
136+
"send": {
137+
"request": {
138+
"jsonrpc": "2.0",
139+
"id": "shutdown",
140+
"method": "shutdown",
141+
"params": null
142+
},
143+
"wait": [{ "id": "shutdown", "result": null }]
144+
}
145+
},
146+
{
147+
"send": {
148+
"request": { "jsonrpc": "2.0", "method": "exit" },
149+
"wait": []
150+
}
151+
},
152+
{
153+
"stop": {
154+
"exit_code": 0
155+
}
156+
}
157+
]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
procedure Main is
2+
begin
3+
null;
4+
end Main;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: 'rename.out_of_project'

0 commit comments

Comments
 (0)