aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-15 10:20:00 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-15 10:51:10 -0400
commitb5a7a087a5c91ef320eaabf5685604bda83eff68 (patch)
tree7d5d0300e647f0d54f325bb2abe9499bb50d3d3b /tests
parent5dcf2252629655d45ea4e3169f003b4010665fd6 (diff)
Resolve hover for procedure parameter names
Diffstat (limited to 'tests')
-rw-r--r--tests/hover_test.odin52
1 files changed, 34 insertions, 18 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index a69b494..ff22e43 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -2177,7 +2177,7 @@ ast_hover_bitset_enum :: proc(t: ^testing.T) {
}
`,
}
- test.expect_hover( t, &source, "test.Foo: .Aaa")
+ test.expect_hover(t, &source, "test.Foo: .Aaa")
}
@(test)
@@ -2203,7 +2203,7 @@ ast_hover_enumerated_array_key :: proc(t: ^testing.T) {
}
`,
}
- test.expect_hover( t, &source, "test.Foo: .A")
+ test.expect_hover(t, &source, "test.Foo: .A")
}
@(test)
@@ -2229,7 +2229,7 @@ ast_hover_enumerated_array_value :: proc(t: ^testing.T) {
}
`,
}
- test.expect_hover( t, &source, "test.Bar: struct {\n\tbar: int,\n}")
+ test.expect_hover(t, &source, "test.Bar: struct {\n\tbar: int,\n}")
}
@(test)
@@ -2254,7 +2254,7 @@ ast_hover_struct_fields_when_not_specifying_type_at_use :: proc(t: ^testing.T) {
}
`,
}
- test.expect_hover( t, &source, "Bar.foo: Foo")
+ test.expect_hover(t, &source, "Bar.foo: Foo")
}
@(test)
@@ -2278,7 +2278,7 @@ ast_hover_struct_field_value_when_not_specifying_type_at_use :: proc(t: ^testing
}
`,
}
- test.expect_hover( t, &source, "test.Foo: .B")
+ test.expect_hover(t, &source, "test.Foo: .B")
}
@(test)
@@ -2344,7 +2344,7 @@ ast_hover_struct_field_should_show_docs_and_comments :: proc(t: ^testing.T) {
}
`,
}
- test.expect_hover( t, &source, "Foo.a: int // a comment\n a docs")
+ test.expect_hover(t, &source, "Foo.a: int // a comment\n a docs")
}
@(test)
@@ -2358,7 +2358,7 @@ ast_hover_struct_field_should_show_docs_and_comments_field :: proc(t: ^testing.T
}
`,
}
- test.expect_hover( t, &source, "Foo.a: int // a comment\n a docs")
+ test.expect_hover(t, &source, "Foo.a: int // a comment\n a docs")
}
@(test)
@@ -2379,7 +2379,7 @@ ast_hover_struct_field_should_show_docs_and_comments_struct_types :: proc(t: ^te
}
`,
}
- test.expect_hover( t, &source, "Foo.bar: test.Bar // bar comment\n bar docs")
+ test.expect_hover(t, &source, "Foo.bar: test.Bar // bar comment\n bar docs")
}
@(test)
@@ -2398,7 +2398,7 @@ ast_hover_struct_field_should_show_docs_and_comments_procs :: proc(t: ^testing.T
}
`,
}
- test.expect_hover( t, &source, "// bar comment\nFoo.bar: proc(a: int) -> int\n bar docs")
+ test.expect_hover(t, &source, "// bar comment\nFoo.bar: proc(a: int) -> int\n bar docs")
}
@(test)
@@ -2419,7 +2419,7 @@ ast_hover_struct_field_should_show_docs_and_comments_named_procs :: proc(t: ^tes
}
`,
}
- test.expect_hover( t, &source, "// bar comment\nFoo.bar: proc(a: int) -> string\n bar docs")
+ test.expect_hover(t, &source, "// bar comment\nFoo.bar: proc(a: int) -> string\n bar docs")
}
@(test)
@@ -2438,7 +2438,7 @@ ast_hover_struct_field_should_show_docs_and_comments_maps :: proc(t: ^testing.T)
}
`,
}
- test.expect_hover( t, &source, "Foo.bar: map[int]int // bar comment\n bar docs")
+ test.expect_hover(t, &source, "Foo.bar: map[int]int // bar comment\n bar docs")
}
@(test)
@@ -2457,7 +2457,7 @@ ast_hover_struct_field_should_show_docs_and_comments_bit_sets :: proc(t: ^testin
}
`,
}
- test.expect_hover( t, &source, "Foo.bar: bit_set[0 ..< 10] // bar comment\n bar docs")
+ test.expect_hover(t, &source, "Foo.bar: bit_set[0 ..< 10] // bar comment\n bar docs")
}
@(test)
@@ -2481,7 +2481,7 @@ ast_hover_struct_field_should_show_docs_and_comments_unions :: proc(t: ^testing.
}
`,
}
- test.expect_hover( t, &source, "Foo.bar: test.Bar // bar comment\n bar docs")
+ test.expect_hover(t, &source, "Foo.bar: test.Bar // bar comment\n bar docs")
}
@(test)
@@ -2500,7 +2500,7 @@ ast_hover_struct_field_should_show_docs_and_comments_multipointers :: proc(t: ^t
}
`,
}
- test.expect_hover( t, &source, "Foo.bar: [^]int // bar comment\n bar docs")
+ test.expect_hover(t, &source, "Foo.bar: [^]int // bar comment\n bar docs")
}
@(test)
@@ -2519,7 +2519,7 @@ ast_hover_struct_field_should_show_docs_and_comments_dynamic_arrays :: proc(t: ^
}
`,
}
- test.expect_hover( t, &source, "Foo.bar: [dynamic]int // bar comment\n bar docs")
+ test.expect_hover(t, &source, "Foo.bar: [dynamic]int // bar comment\n bar docs")
}
@(test)
@@ -2538,7 +2538,7 @@ ast_hover_struct_field_should_show_docs_and_comments_fixed_arrays :: proc(t: ^te
}
`,
}
- test.expect_hover( t, &source, "Foo.bar: [5]int // bar comment\n bar docs")
+ test.expect_hover(t, &source, "Foo.bar: [5]int // bar comment\n bar docs")
}
@(test)
@@ -2557,7 +2557,7 @@ ast_hover_struct_field_should_show_docs_and_comments_matrix :: proc(t: ^testing.
}
`,
}
- test.expect_hover( t, &source, "Foo.bar: matrix[4,5]int // bar comment\n bar docs")
+ test.expect_hover(t, &source, "Foo.bar: matrix[4,5]int // bar comment\n bar docs")
}
@(test)
@@ -2580,7 +2580,23 @@ ast_hover_variable_from_comparison :: proc(t: ^testing.T) {
}
`,
}
- test.expect_hover( t, &source, "test.bazz: bool")
+ test.expect_hover(t, &source, "test.bazz: bool")
+}
+
+@(test)
+ast_hover_named_parameter_same_as_variable :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+
+ foo :: proc(a: int) {}
+
+ main :: proc() {
+ a := "hellope"
+ foo(a{*} = 0)
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "foo.a: int")
}
/*