aboutsummaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-17 08:29:31 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-17 08:29:31 -0400
commitd04d9bee6bfa157d863387d135d9d05315fcb864 (patch)
treed18be7afa8afaaf2a5ebeeed12ca8577183f5a74 /tests/hover_test.odin
parent6e2c8ed552f823ad3360c00f66949a91efb7760b (diff)
Show proc calling convention and tags in proc types defined in struct fields
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 7da1b46..68fe170 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -1867,7 +1867,7 @@ ast_hover_poly_struct_poly_proc_fields :: proc(t: ^testing.T) {
test.expect_hover(
t,
&source,
- "test.Foo: struct($S: typeid, $T: typeid) {\n\tmy_proc1: proc(s: S) -> ^S,\n\tmy_proc2: proc(t: ^T) -> T,\n\tmy_proc3: proc(s: ^S,t: T) -> T,\n\tmy_proc4: proc() -> T,\n\tmy_proc5: proc(t: T),\n\tfoo1: T,\n\tfoo2: ^S,\n}",
+ "test.Foo: struct($S: typeid, $T: typeid) {\n\tmy_proc1: proc(s: S) -> ^S,\n\tmy_proc2: proc(t: ^T) -> T,\n\tmy_proc3: proc(s: ^S, t: T) -> T,\n\tmy_proc4: proc() -> T,\n\tmy_proc5: proc(t: T),\n\tfoo1: T,\n\tfoo2: ^S,\n}",
)
}
@@ -1904,7 +1904,7 @@ ast_hover_poly_struct_poly_proc_fields_resolved :: proc(t: ^testing.T) {
test.expect_hover(
t,
&source,
- "test.Foo: struct(Bar, my_package.Bazz) {\n\tmy_proc1: proc(s: Bar) -> ^Bar,\n\tmy_proc2: proc(t: my_package.Bazz) -> my_package.Bazz,\n\tmy_proc3: proc(s: ^my_package.Bazz,t: my_package.Bazz) -> my_package.Bazz,\n\tfoo1: my_package.Bazz,\n\tfoo2: ^Bar,\n}",
+ "test.Foo: struct(Bar, my_package.Bazz) {\n\tmy_proc1: proc(s: Bar) -> ^Bar,\n\tmy_proc2: proc(t: my_package.Bazz) -> my_package.Bazz,\n\tmy_proc3: proc(s: ^my_package.Bazz, t: my_package.Bazz) -> my_package.Bazz,\n\tfoo1: my_package.Bazz,\n\tfoo2: ^Bar,\n}",
)
}
@@ -4036,6 +4036,18 @@ ast_hover_struct_container_fields :: proc(t: ^testing.T) {
test.expect_hover(t, &source, "test.Foo: struct {\n\tfoo_slice: []int,\n\tfoo_dynamic: [dynamic]int,\n\tfoo_array: [5]int,\n\tfoo_map: map[int]int,\n\tfoo_matrix: matrix[3,4]int,\n}")
}
+@(test)
+ast_hover_struct_field_proc_calling_convention :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ F{*}oo :: struct {
+ foo_proc: proc "c" (a: int, b: int) -> int,
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.Foo: struct {\n\tfoo_proc: proc \"c\" (a: int, b: int) -> int,\n}")
+}
+
/*
Waiting for odin fix