aboutsummaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-21 09:26:17 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-21 09:26:17 -0400
commit405e8ede2eaf2fbccb6ffbaa6b24a434665b056d (patch)
tree94260d847a212263ea5c4303f16fb4748921bca5 /tests/hover_test.odin
parentee22998e6e8beec8e3926c9c6b1a0dbd99b3d6db (diff)
Improve comp lit hover formatting
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin36
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index bed597c..fc66f64 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -237,7 +237,7 @@ ast_hover_on_array_infer_length_variable :: proc(t: ^testing.T) {
`,
}
- test.expect_hover(t, &source, "test.vec :: [?]f32 {\n\t1,\n\t2,\n\t3,\n}")
+ test.expect_hover(t, &source, "test.vec :: [?]f32{1, 2, 3}")
}
@(test)
@@ -4924,6 +4924,40 @@ ast_hover_const_binary_expr :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.FOO :: 3 + 4")
}
+
+@(test)
+ast_hover_const_complex_comp_lit :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ frgba :: distinct [4]f32
+
+ COLOUR_BLUE :: frgba{0.1, 0.1, 0.1, 0.1}
+
+ Foo :: struct {
+ a: int,
+ b: string,
+ }
+
+ Colours :: struct {
+ blue: frgba,
+ green: frgba,
+ foo: Foo,
+ bar: int,
+ }
+
+ COL{*}OURS :: Colours {
+ blue = frgba{0.1, 0.1, 0.1, 0.1},
+ green = frgba{0.1, 0.1, 0.1, 0.1},
+ foo = {
+ a = 32,
+ b = "testing"
+ },
+ bar = 1 + 2,
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.COLOURS :: Colours {\n\tblue = frgba{0.1, 0.1, 0.1, 0.1},\n\tgreen = frgba{0.1, 0.1, 0.1, 0.1},\n\tfoo = {\n\t\ta = 32,\n\t\tb = \"testing\",\n\t},\n\tbar = 1 + 2,\n}")
+}
/*
Waiting for odin fix