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. --- src/server/analysis.odin | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/server') diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 3d5cbc1..65d1140 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -1833,6 +1833,23 @@ resolve_implicit_selector :: proc( } } + if position_context.index != nil { + symbol: Symbol + ok := false + if position_context.previous_index != nil { + symbol, ok = resolve_type_expression(ast_context, position_context.previous_index) + if !ok { + return {}, false + } + } else { + symbol, ok = resolve_type_expression(ast_context, position_context.index.expr) + } + + if array, ok := symbol.value.(SymbolFixedArrayValue); ok { + return resolve_type_expression(ast_context, array.len) + } + } + if position_context.returns != nil && position_context.function != nil { return_index: int -- cgit v1.2.3