aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-10 20:29:43 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-10 20:30:09 -0400
commitf3ae71ff7f6e3713e42c9fc65c735babba5caff0 (patch)
treef9f4f6c98c651b41e5ce493f09b3e8b38405fc5d /src/server
parent412da606f42f29a6f03392ff385bea6a3af60bb2 (diff)
Resolve assign comp lits
Diffstat (limited to 'src/server')
-rw-r--r--src/server/analysis.odin15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index d5ba9d1..f19df28 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1997,6 +1997,21 @@ internal_resolve_comp_literal :: proc(
}
} else if position_context.value_decl != nil && position_context.value_decl.type != nil {
symbol = resolve_proc(ast_context, position_context.value_decl.type) or_return
+ } else if position_context.assign != nil {
+ if len(position_context.assign.lhs) > 0 {
+ index := 0
+ for value, i in position_context.assign.rhs {
+ if position_in_node(value, position_context.position) {
+ index = i
+ break
+ }
+ }
+ // Just to be safe
+ if index >= len(position_context.assign.lhs) {
+ index = 0
+ }
+ symbol = resolve_proc(ast_context, position_context.assign.lhs[index]) or_return
+ }
}
set_ast_package_set_scoped(ast_context, symbol.pkg)