diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-07-15 13:44:48 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-07-15 13:44:48 -0400 |
| commit | ba460eeccf68bf7585bf4f51aa10654ba78d7877 (patch) | |
| tree | bce1f289a5a2454a446c732a8750c661e187602a /src/server/analysis.odin | |
| parent | 428b54c588ba00c84b60ed5d24cec1b264fa5589 (diff) | |
Consolidate resolving proc param names
Diffstat (limited to 'src/server/analysis.odin')
| -rw-r--r-- | src/server/analysis.odin | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index e3e1f6d..170b477 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -2232,6 +2232,31 @@ resolve_location_proc_param_name :: proc( return symbol, true } +resolve_type_location_proc_param_name :: proc( + ast_context: ^AstContext, + position_context: ^DocumentPositionContext, +) -> ( + call_symbol: Symbol, + ok: bool, +) { + ident := position_context.field_value.field.derived.(^ast.Ident) or_return + call := position_context.call.derived.(^ast.Call_Expr) or_return + call_symbol = resolve_type_expression(ast_context, call) or_return + + if value, ok := call_symbol.value.(SymbolProcedureValue); ok { + if arg_type, ok := get_proc_arg_type_from_name(value, ident.name); ok { + if symbol, ok := resolve_type_expression(ast_context, arg_type.type); ok { + symbol.type_pkg = symbol.pkg + symbol.type_name = symbol.name + symbol.pkg = call_symbol.name + symbol.name = ident.name + return symbol, true + } + } + } + return call_symbol, false +} + resolve_location_comp_lit_field :: proc( ast_context: ^AstContext, position_context: ^DocumentPositionContext, |