From 62846aac929398e4f80fccff29006bea67112aa8 Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Wed, 25 Jun 2025 01:16:50 +0200 Subject: Add better support for goto and hover in index of enumerated array. --- tests/definition_test.odin | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests') diff --git a/tests/definition_test.odin b/tests/definition_test.odin index 35384b6..981adf2 100644 --- a/tests/definition_test.odin +++ b/tests/definition_test.odin @@ -30,6 +30,34 @@ ast_goto_bit_set_comp_literal :: proc(t: ^testing.T) { test.expect_definition_locations(t, &source, {location}) } +@(test) +ast_goto_bit_set_index_enumerated_array :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + TestEnum :: enum { + valueOne, + valueTwo, + } + + EnumIndexedArray :: [TestEnum]u32 { + .valueOne = 1, + .valueTwo = 2, + } + + my_proc :: proc() -> u32 { + arr :: EnumIndexedArray + return arr[.valueO{*}ne] + } + `, + } + + location := common.Location { + range = {start = {line = 2, character = 3}, end = {line = 2, character = 11}}, + } + + test.expect_definition_locations(t, &source, {location}) +} + @(test) ast_goto_comp_lit_field :: proc(t: ^testing.T) { -- cgit v1.2.3