Skip to content

Commit 9874984

Browse files
Merge branch 'topic/rename-protected' into 'master'
Add test for renaming protected procedures See merge request eng/ide/ada_language_server!2207
2 parents 10a24b1 + e38fd8b commit 9874984

File tree

4 files changed

+152
-0
lines changed

4 files changed

+152
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
project Default is
2+
end Default;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
procedure Main is
2+
protected M is
3+
procedure Foo;
4+
end M;
5+
6+
protected body M is
7+
procedure Foo is
8+
begin
9+
null;
10+
end Foo;
11+
end M;
12+
begin
13+
null;
14+
end Main;
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
[
2+
{
3+
"comment": ["This test checks renaming a protected procedure."]
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+
"renameProvider": {}
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{main.adb}",
55+
"languageId": "ada",
56+
"version": 1,
57+
"text": "procedure Main is\n protected M is\n procedure Foo;\n end M;\n\n protected body M is\n procedure Foo is\n begin\n null;\n end Foo;\n end M;\nbegin\n null;\nend Main;\n"
58+
}
59+
}
60+
},
61+
"wait": []
62+
}
63+
},
64+
{
65+
"send": {
66+
"request": {
67+
"jsonrpc": "2.0",
68+
"id": "1",
69+
"method": "textDocument/rename",
70+
"params": {
71+
"textDocument": {
72+
"uri": "$URI{main.adb}"
73+
},
74+
"position": {
75+
"line": 2,
76+
"character": 18
77+
},
78+
"newName": "Bar"
79+
}
80+
},
81+
"wait": [
82+
{
83+
"id": "1",
84+
"result": {
85+
"changes": {
86+
"$URI{main.adb}": [
87+
{
88+
"range": {
89+
"start": { "line": 2, "character": 16 },
90+
"end": { "line": 2, "character": 19 }
91+
},
92+
"newText": "Bar"
93+
},
94+
{
95+
"range": {
96+
"start": { "line": 6, "character": 16 },
97+
"end": { "line": 6, "character": 19 }
98+
},
99+
"newText": "Bar"
100+
},
101+
{
102+
"range": {
103+
"start": { "line": 9, "character": 10 },
104+
"end": { "line": 9, "character": 13 }
105+
},
106+
"newText": "Bar"
107+
}
108+
]
109+
}
110+
}
111+
}
112+
]
113+
}
114+
},
115+
{
116+
"send": {
117+
"request": {
118+
"jsonrpc": "2.0",
119+
"id": 3,
120+
"method": "shutdown"
121+
},
122+
"wait": [
123+
{
124+
"id": 3,
125+
"result": null
126+
}
127+
]
128+
}
129+
},
130+
{
131+
"stop": {
132+
"exit_code": 0
133+
}
134+
}
135+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: 'rename.protected_procedure'

0 commit comments

Comments
 (0)