aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-11-13 15:51:53 -0500
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-11-13 15:51:53 -0500
commit72cdc7e38a57782209148a6dbf6f6e1aa2598916 (patch)
tree12f43e94d47f43ad9cfbd73aec30c6f4aa5f8f23 /src/server
parentdd4ff896dbd188762bcadede367552544d08a860 (diff)
Fix resolving named call arg types at call site
Diffstat (limited to 'src/server')
-rw-r--r--src/server/analysis.odin26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index aa19e56..f724345 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -2744,13 +2744,25 @@ resolve_type_location_proc_param_name :: proc(
reset_ast_context(ast_context)
if value, ok := call_symbol.value.(SymbolProcedureValue); ok {
- if symbol, ok := resolve_type_expression(ast_context, position_context.field_value.value); ok {
- symbol.type_pkg = symbol.pkg
- symbol.type_name = symbol.name
- symbol.pkg = call_symbol.name
- symbol.name = ident.name
- symbol.type = .Field
- return symbol, true
+ for arg in value.arg_types {
+ for name_expr in arg.names {
+ if name, ok := name_expr.derived.(^ast.Ident); ok {
+ if name.name == ident.name {
+ type := arg.type
+ if type == nil {
+ type = arg.default_value
+ }
+ if symbol, ok := resolve_type_expression(ast_context, type); ok {
+ symbol.type_pkg = symbol.pkg
+ symbol.type_name = symbol.name
+ symbol.pkg = call_symbol.name
+ symbol.name = ident.name
+ symbol.type = .Field
+ return symbol, true
+ }
+ }
+ }
+ }
}
}
return call_symbol, false