Skip to content

Commit efd541f

Browse files
BoulangerAdrienBoulanger
authored andcommitted
Add a test for gls
1 parent b4573a8 commit efd541f

File tree

4 files changed

+228
-10
lines changed

4 files changed

+228
-10
lines changed

testsuite/ada_lsp/configuration_warning_changing_setting/test-loc.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
project Test is
2+
end Test;
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
[
2+
{
3+
"comment": [
4+
"Test publishDiagnostics request when doing a didChangeConfiguration"
5+
]
6+
},
7+
{
8+
"start": {
9+
"cmd": ["${ALS}", "--language-gpr"]
10+
}
11+
},
12+
{
13+
"send": {
14+
"request": {
15+
"params": {
16+
"capabilities": {},
17+
"rootUri": "$URI{.}"
18+
},
19+
"id": 1,
20+
"method": "initialize"
21+
},
22+
"wait": [
23+
{
24+
"id": 1,
25+
"result": {
26+
"capabilities": {
27+
"textDocumentSync": {
28+
"openClose": true,
29+
"change": 1
30+
}
31+
}
32+
}
33+
}
34+
]
35+
}
36+
},
37+
{
38+
"send": {
39+
"request": {
40+
"jsonrpc": "2.0",
41+
"method": "initialized"
42+
},
43+
"wait": []
44+
}
45+
},
46+
{
47+
"send": {
48+
"request": {
49+
"params": {
50+
"textDocument": {
51+
"text": "project Test is\nend Test;",
52+
"version": 0,
53+
"uri": "$URI{default.gpr}",
54+
"languageId": "Gpr"
55+
}
56+
},
57+
"jsonrpc": "2.0",
58+
"method": "textDocument/didOpen"
59+
},
60+
"wait": [
61+
{
62+
"method": "textDocument/publishDiagnostics",
63+
"params": {
64+
"uri": "$URI{default.gpr}",
65+
"diagnostics": [
66+
{
67+
"message": "project name 'default' expected",
68+
"range": {
69+
"end": {
70+
"character": 8,
71+
"line": 0
72+
},
73+
"start": {
74+
"character": 8,
75+
"line": 0
76+
}
77+
},
78+
"severity": 2,
79+
"source": "gpr.project"
80+
},
81+
{
82+
"message": "there are no sources of language \"Ada\" in this project",
83+
"range": {
84+
"end": {
85+
"character": 0,
86+
"line": 0
87+
},
88+
"start": {
89+
"character": 0,
90+
"line": 0
91+
}
92+
},
93+
"severity": 2,
94+
"source": "gpr.project"
95+
}
96+
]
97+
}
98+
}
99+
]
100+
}
101+
},
102+
{
103+
"send": {
104+
"request": {
105+
"jsonrpc": "2.0",
106+
"method": "workspace/didChangeConfiguration",
107+
"params": {
108+
"settings": {
109+
"ada": {
110+
"adaFileDiagnostics": true,
111+
"alireDiagnostics": false,
112+
"defaultCharset": "ISO-8859-1",
113+
"documentationStyle": "gnat",
114+
"foldComments": false,
115+
"followSymlinks": false,
116+
"gprFileDiagnostics": false,
117+
"insertWithClauses": true,
118+
"namedNotationThreshold": 3,
119+
"projectDiagnostics": true,
120+
"projectFile": "$URI{test.gpr}",
121+
"scenarioVariables": {},
122+
"useGnatformat": true
123+
}
124+
}
125+
}
126+
},
127+
"wait": [
128+
{
129+
"method": "textDocument/publishDiagnostics",
130+
"params": {
131+
"uri": "$URI{default.gpr}",
132+
"diagnostics": []
133+
}
134+
}
135+
]
136+
}
137+
},
138+
{
139+
"send": {
140+
"request": {
141+
"jsonrpc": "2.0",
142+
"method": "workspace/didChangeConfiguration",
143+
"params": {
144+
"settings": {
145+
"ada": {
146+
"adaFileDiagnostics": true,
147+
"alireDiagnostics": false,
148+
"defaultCharset": "ISO-8859-1",
149+
"documentationStyle": "gnat",
150+
"foldComments": false,
151+
"followSymlinks": false,
152+
"gprFileDiagnostics": true,
153+
"insertWithClauses": true,
154+
"namedNotationThreshold": 3,
155+
"projectDiagnostics": false,
156+
"projectFile": "$URI{test.gpr}",
157+
"scenarioVariables": {},
158+
"useGnatformat": true
159+
}
160+
}
161+
}
162+
},
163+
"wait": [
164+
{
165+
"method": "textDocument/publishDiagnostics",
166+
"params": {
167+
"uri": "$URI{default.gpr}",
168+
"diagnostics": [
169+
{
170+
"message": "project name 'default' expected",
171+
"range": {
172+
"end": {
173+
"character": 8,
174+
"line": 0
175+
},
176+
"start": {
177+
"character": 8,
178+
"line": 0
179+
}
180+
},
181+
"severity": 2,
182+
"source": "gpr.project"
183+
},
184+
{
185+
"message": "there are no sources of language \"Ada\" in this project",
186+
"range": {
187+
"end": {
188+
"character": 0,
189+
"line": 0
190+
},
191+
"start": {
192+
"character": 0,
193+
"line": 0
194+
}
195+
},
196+
"severity": 2,
197+
"source": "gpr.project"
198+
}
199+
]
200+
}
201+
}
202+
]
203+
}
204+
},
205+
{
206+
"send": {
207+
"request": {
208+
"jsonrpc": "2.0",
209+
"id": 7,
210+
"method": "shutdown"
211+
},
212+
"wait": [
213+
{
214+
"id": 7,
215+
"result": null
216+
}
217+
]
218+
}
219+
},
220+
{
221+
"stop": {
222+
"exit_code": 0
223+
}
224+
}
225+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: 'diagnostic_settings_refresh'

0 commit comments

Comments
 (0)