From 2f08ec6e76d1825825cd6a5b9292b760782e00b4 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Tue, 12 Aug 2025 20:12:31 -0400 Subject: Fix go to type definition on a variable in a comp lit --- src/server/type_definition.odin | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/type_definition.odin b/src/server/type_definition.odin index db0b587..7ad9c26 100644 --- a/src/server/type_definition.odin +++ b/src/server/type_definition.odin @@ -103,13 +103,6 @@ get_type_definition_locations :: proc(document: ^Document, position: common.Posi } } - if position_context.comp_lit != nil { - if symbol, ok := resolve_location_comp_literal(&ast_context, &position_context); ok { - append_symbol_to_locations(&locations, document, symbol) - return locations[:], true - } - } - if position_context.call != nil { if call, ok := position_context.call.derived.(^ast.Call_Expr); ok { if !position_in_exprs(call.args, position_context.position) { @@ -258,5 +251,12 @@ get_type_definition_locations :: proc(document: ^Document, position: common.Posi } } + if position_context.comp_lit != nil { + if symbol, ok := resolve_location_comp_literal(&ast_context, &position_context); ok { + append_symbol_to_locations(&locations, document, symbol) + return locations[:], true + } + } + return {}, false } -- cgit v1.2.3