Skip to content

Commit 0a45551

Browse files
authored
Add LSP hover integration tests (#5106)
Adds end-to-end hover tests covering classes, actors, traits, interfaces, primitives, aliases, type inference, receiver capabilities, complex types, generic types, and function signatures. Tests share a single LSP server instance that compiles the workspace once. Renames _hover_tests.pony to _hover_formatter_tests.pony to distinguish unit tests from integration tests.
1 parent bcdeeb9 commit 0a45551

15 files changed

+835
-22
lines changed

tools/pony-lsp/test/_hover_tests.pony renamed to tools/pony-lsp/test/_hover_formatter_tests.pony

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use "pony_test"
22
use "../workspace"
33

4-
primitive _HoverTests is TestList
4+
primitive _HoverFormatterTests is TestList
55
new make() =>
66
None
77

@@ -33,7 +33,7 @@ primitive _HoverTests is TestList
3333

3434
class \nodoc\ iso _HoverFormatEntityTest
3535
is UnitTest
36-
fun name(): String => "hover/format_entity"
36+
fun name(): String => "hover/formatter/entity"
3737

3838
fun apply(h: TestHelper) =>
3939
let info = EntityInfo("class", "MyClass")
@@ -46,7 +46,7 @@ class \nodoc\ iso
4646
_HoverFormatEntityWithTypeParamsTest
4747
is UnitTest
4848
fun name(): String =>
49-
"hover/format_entity_with_type_params"
49+
"hover/formatter/entity_with_type_params"
5050

5151
fun apply(h: TestHelper) =>
5252
let info =
@@ -62,7 +62,7 @@ class \nodoc\ iso
6262
_HoverFormatEntityWithDocstringTest
6363
is UnitTest
6464
fun name(): String =>
65-
"hover/format_entity_with_docstring"
65+
"hover/formatter/entity_with_docstring"
6666

6767
fun apply(h: TestHelper) =>
6868
let info =
@@ -80,7 +80,7 @@ class \nodoc\ iso
8080

8181
class \nodoc\ iso _HoverFormatMethodTest
8282
is UnitTest
83-
fun name(): String => "hover/format_method"
83+
fun name(): String => "hover/formatter/method"
8484

8585
fun apply(h: TestHelper) =>
8686
let info = MethodInfo("fun", "my_method", "")
@@ -93,7 +93,7 @@ class \nodoc\ iso
9393
_HoverFormatMethodWithReturnTypeTest
9494
is UnitTest
9595
fun name(): String =>
96-
"hover/format_method_with_return_type"
96+
"hover/formatter/method_with_return_type"
9797

9898
fun apply(h: TestHelper) =>
9999
let info =
@@ -115,7 +115,7 @@ class \nodoc\ iso
115115
_HoverFormatMethodWithDocstringTest
116116
is UnitTest
117117
fun name(): String =>
118-
"hover/format_method_with_docstring"
118+
"hover/formatter/method_with_docstring"
119119

120120
fun apply(h: TestHelper) =>
121121
let info =
@@ -137,7 +137,7 @@ class \nodoc\ iso
137137

138138
class \nodoc\ iso _HoverFormatFieldTest
139139
is UnitTest
140-
fun name(): String => "hover/format_field"
140+
fun name(): String => "hover/formatter/field"
141141

142142
fun apply(h: TestHelper) =>
143143
let info = FieldInfo("let", "name")
@@ -150,7 +150,7 @@ class \nodoc\ iso
150150
_HoverFormatFieldWithTypeTest
151151
is UnitTest
152152
fun name(): String =>
153-
"hover/format_field_with_type"
153+
"hover/formatter/field_with_type"
154154

155155
fun apply(h: TestHelper) =>
156156
let info = FieldInfo("var", "count", ": U32")
@@ -163,7 +163,7 @@ class \nodoc\ iso
163163
_HoverFormatMethodWithTypeParamsTest
164164
is UnitTest
165165
fun name(): String =>
166-
"hover/format_method_with_type_params"
166+
"hover/formatter/method_with_type_params"
167167

168168
fun apply(h: TestHelper) =>
169169
let info =
@@ -186,7 +186,7 @@ class \nodoc\ iso
186186
_HoverFormatEntityWithMultipleTypeParamsTest
187187
is UnitTest
188188
fun name(): String =>
189-
"hover/format_entity_with_multiple_type_params"
189+
"hover/formatter/entity_with_multiple_type_params"
190190

191191
fun apply(h: TestHelper) =>
192192
let info =
@@ -205,7 +205,7 @@ class \nodoc\ iso
205205
_HoverFormatFieldWithGenericTypeTest
206206
is UnitTest
207207
fun name(): String =>
208-
"hover/format_field_with_generic_type"
208+
"hover/formatter/field_with_generic_type"
209209

210210
fun apply(h: TestHelper) =>
211211
let info =
@@ -224,7 +224,7 @@ class \nodoc\ iso
224224
_HoverFormatMethodWithArrowTypeTest
225225
is UnitTest
226226
fun name(): String =>
227-
"hover/format_method_with_arrow_type"
227+
"hover/formatter/method_with_arrow_type"
228228

229229
fun apply(h: TestHelper) =>
230230
let info =
@@ -246,7 +246,7 @@ class \nodoc\ iso
246246
_HoverFormatFieldWithUnionTypeTest
247247
is UnitTest
248248
fun name(): String =>
249-
"hover/format_field_with_union_type"
249+
"hover/formatter/field_with_union_type"
250250

251251
fun apply(h: TestHelper) =>
252252
let info =
@@ -266,7 +266,7 @@ class \nodoc\ iso
266266
_HoverFormatFieldWithTupleTypeTest
267267
is UnitTest
268268
fun name(): String =>
269-
"hover/format_field_with_tuple_type"
269+
"hover/formatter/field_with_tuple_type"
270270

271271
fun apply(h: TestHelper) =>
272272
let info =
@@ -285,7 +285,7 @@ class \nodoc\ iso
285285
_HoverFormatMethodWithCompleteSignatureTest
286286
is UnitTest
287287
fun name(): String =>
288-
"hover/format_method_with_complete_signature"
288+
"hover/formatter/method_with_complete_signature"
289289

290290
fun apply(h: TestHelper) =>
291291
let info =
@@ -311,7 +311,7 @@ class \nodoc\ iso
311311
_HoverFormatEntityWithTypeParamsAndDocstringTest
312312
is UnitTest
313313
fun name(): String =>
314-
"hover/format_entity_with_" +
314+
"hover/formatter/entity_with_" +
315315
"type_params_and_docstring"
316316

317317
fun apply(h: TestHelper) =>
@@ -333,7 +333,7 @@ class \nodoc\ iso
333333
_HoverFormatFieldWithNestedGenericTypeTest
334334
is UnitTest
335335
fun name(): String =>
336-
"hover/format_field_with_nested_generic_type"
336+
"hover/formatter/field_with_nested_generic_type"
337337

338338
fun apply(h: TestHelper) =>
339339
let info =
@@ -351,7 +351,7 @@ class \nodoc\ iso
351351

352352
class \nodoc\ iso _HoverFormatParameterTest
353353
is UnitTest
354-
fun name(): String => "hover/format_parameter"
354+
fun name(): String => "hover/formatter/parameter"
355355

356356
fun apply(h: TestHelper) =>
357357
let info = FieldInfo("param", "value")
@@ -364,7 +364,7 @@ class \nodoc\ iso
364364
_HoverFormatParameterWithTypeTest
365365
is UnitTest
366366
fun name(): String =>
367-
"hover/format_parameter_with_type"
367+
"hover/formatter/parameter_with_type"
368368

369369
fun apply(h: TestHelper) =>
370370
let info =
@@ -378,7 +378,7 @@ class \nodoc\ iso
378378
_HoverFormatMethodWithReceiverCapTest
379379
is UnitTest
380380
fun name(): String =>
381-
"hover/format_method_with_receiver_cap"
381+
"hover/formatter/method_with_receiver_cap"
382382

383383
fun apply(h: TestHelper) =>
384384
let info =

0 commit comments

Comments
 (0)