From d9e64b659b4e3a6bd3e0b06683705dcb91b951df Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Sun, 9 Nov 2025 14:58:26 -0500 Subject: Correctly resolve exprs when immediately indexing or slicing a function call --- tests/hover_test.odin | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests') diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 9a1f47e..09f4bb9 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -5571,6 +5571,34 @@ ast_hover_soa_poly_proc :: proc(t: ^testing.T) { } test.expect_hover(t, &source, "test.bar: #soa^#soa[dynamic]struct{}") } + +@(test) +ast_hover_slice_function_call :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + foo :: proc() -> []int {} + + main :: proc() { + x{*} := foo()[:1] + } + `, + } + test.expect_hover(t, &source, "test.x: []int") +} + +@(test) +ast_hover_index_function_call :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + foo :: proc() -> []int {} + + main :: proc() { + x{*} := foo()[0] + } + `, + } + test.expect_hover(t, &source, "test.x: int") +} /* Waiting for odin fix -- cgit v1.2.3