Skip to content

Commit fda1058

Browse files
committed
UB30-006 Add whole file range formatting test
1 parent 926dd8c commit fda1058

File tree

4 files changed

+195
-0
lines changed

4 files changed

+195
-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 Main use ("main.adb");
3+
end Default;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
procedure Main is
2+
3+
begin
4+
declare
5+
A : Integer;
6+
begin
7+
null;
8+
end;
9+
10+
end Main;
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
[
2+
{
3+
"comment": [
4+
"test automatically generated"
5+
]
6+
},
7+
{
8+
"start": {
9+
"cmd": [
10+
"${ALS}"
11+
]
12+
}
13+
},
14+
{
15+
"send": {
16+
"request": {
17+
"jsonrpc": "2.0",
18+
"id": 0,
19+
"method": "initialize",
20+
"params": {
21+
"processId": 84339,
22+
"locale": "en-gb",
23+
"rootPath": "$URI{.}",
24+
"rootUri": "$URI{.}",
25+
"capabilities": {
26+
"workspace": {
27+
"applyEdit": true,
28+
"workspaceEdit": {
29+
"documentChanges": true,
30+
"resourceOperations": [
31+
"create",
32+
"rename",
33+
"delete"
34+
]
35+
},
36+
"executeCommand": {
37+
"dynamicRegistration": true
38+
}
39+
},
40+
"textDocument": {
41+
"codeAction": {
42+
"dynamicRegistration": true,
43+
"codeActionLiteralSupport": {
44+
"codeActionKind": {
45+
"valueSet": [
46+
"<HAS>",
47+
"refactor",
48+
"refactor.extract",
49+
"refactor.inline",
50+
"refactor.rewrite"
51+
]
52+
}
53+
}
54+
}
55+
}
56+
}
57+
}
58+
},
59+
"wait": [
60+
{
61+
"jsonrpc": "2.0",
62+
"id": 0
63+
}
64+
]
65+
}
66+
},
67+
{
68+
"send": {
69+
"request": {
70+
"jsonrpc": "2.0",
71+
"method": "initialized",
72+
"params": {}
73+
},
74+
"wait": []
75+
}
76+
},
77+
{
78+
"send": {
79+
"request": {
80+
"jsonrpc": "2.0",
81+
"method": "workspace/didChangeConfiguration",
82+
"params": {
83+
"settings": {
84+
"ada": {
85+
"trace": {
86+
"server": "verbose"
87+
},
88+
"projectFile": "default.gpr",
89+
"scenarioVariables": {},
90+
"defaultCharset": "iso-8859-1",
91+
"displayMethodAncestryOnNavigation": "usage_and_abstract_only",
92+
"enableDiagnostics": true,
93+
"useCompletionSnippets": true,
94+
"renameInComments": true
95+
}
96+
}
97+
}
98+
},
99+
"wait": [
100+
{
101+
"jsonrpc": "2.0",
102+
"id": 2,
103+
"method": "window/workDoneProgress/create",
104+
"params": {
105+
"token": "<ANY>"
106+
}
107+
}
108+
]
109+
}
110+
},
111+
{
112+
"send": {
113+
"request": {
114+
"jsonrpc": "2.0",
115+
"method": "textDocument/didOpen",
116+
"params": {
117+
"textDocument": {
118+
"uri": "$URI{main.adb}",
119+
"languageId": "ada",
120+
"version": 1,
121+
"text": "procedure Main is\n\nbegin\n declare\n A : Integer;\n begin\n null;\n end;\n\nend Main;"
122+
}
123+
}
124+
},
125+
"wait": []
126+
}
127+
},
128+
{
129+
"send": {
130+
"request": {
131+
"jsonrpc": "2.0",
132+
"id": 12,
133+
"method": "textDocument/rangeFormatting",
134+
"params": {
135+
"textDocument": {
136+
"uri": "$URI{main.adb}"
137+
},
138+
"range": {
139+
"start": {
140+
"line": 0,
141+
"character": 12
142+
},
143+
"end": {
144+
"line": 9,
145+
"character": 6
146+
}
147+
},
148+
"options": {
149+
"tabSize": 3,
150+
"insertSpaces": true
151+
}
152+
}
153+
},
154+
"wait": [
155+
{
156+
"id": 12,
157+
"result": [
158+
{
159+
"range": {
160+
"start": {
161+
"line": 0,
162+
"character": 0
163+
},
164+
"end": {
165+
"line": 9,
166+
"character": 9
167+
}
168+
},
169+
"newText": "procedure Main is\n\nbegin\n declare\n A : Integer;\n begin\n null;\n end;\n\nend Main;"
170+
}
171+
]
172+
}
173+
]
174+
}
175+
},
176+
{
177+
"stop": {
178+
"exit_code": 0
179+
}
180+
}
181+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: 'UB30-006_range_format_whole_document'

0 commit comments

Comments
 (0)