From 225b794cd3bbb0f116a4cf6e389aa5194c5eca46 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Sun, 21 Sep 2025 10:00:48 -0400 Subject: Add `#type` to proc type hover information to distinguish with proc implementations --- tests/hover_test.odin | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/hover_test.odin b/tests/hover_test.odin index fc66f64..562a2d6 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -182,7 +182,7 @@ ast_hover_procedure_with_default_comp_lit :: proc(t: ^testing.T) { `, } - test.expect_hover(t, &source, "test.fa :: proc(color_: Color = {255, 255, 255, 255})") + test.expect_hover(t, &source, "test.fa :: #type proc(color_: Color = {255, 255, 255, 255})") } @(test) @@ -4958,6 +4958,28 @@ ast_hover_const_complex_comp_lit :: proc(t: ^testing.T) { } 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}") } + +@(test) +ast_hover_proc_type :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + f{*}oo :: proc(a: int) -> int + `, + } + test.expect_hover(t, &source, "test.foo :: #type proc(a: int) -> int") +} + +@(test) +ast_hover_proc_impl :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + f{*}oo :: proc(a: int) -> int { + return a + 1 + } + `, + } + test.expect_hover(t, &source, "test.foo :: proc(a: int) -> int") +} /* Waiting for odin fix -- cgit v1.2.3