diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-17 08:29:31 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-17 08:29:31 -0400 |
| commit | d04d9bee6bfa157d863387d135d9d05315fcb864 (patch) | |
| tree | d18be7afa8afaaf2a5ebeeed12ca8577183f5a74 /src/server | |
| parent | 6e2c8ed552f823ad3360c00f66949a91efb7760b (diff) | |
Show proc calling convention and tags in proc types defined in struct fields
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/analysis.odin | 24 | ||||
| -rw-r--r-- | src/server/documentation.odin | 3 |
2 files changed, 17 insertions, 10 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 3060e7d..1524112 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -1080,7 +1080,7 @@ internal_resolve_type_expression :: proc(ast_context: ^AstContext, node: ^ast.Ex out^, ok = make_symbol_map_from_ast(ast_context, v^, ast_context.field_name), true return ok case ^Proc_Type: - out^, ok = make_symbol_procedure_from_ast(ast_context, node, v^, ast_context.field_name, {}, true, .None), true + out^, ok = make_symbol_procedure_from_ast(ast_context, node, v^, ast_context.field_name.name, {}, true, .None), true return ok case ^Bit_Field_Type: out^, ok = make_symbol_bit_field_from_ast(ast_context, v, ast_context.field_name.name, true), true @@ -1620,11 +1620,11 @@ resolve_local_identifier :: proc(ast_context: ^AstContext, node: ast.Ident, loca if !ok && !ast_context.overloading { return_symbol, ok = - make_symbol_procedure_from_ast(ast_context, local.rhs, v.type^, node, {}, false, v.inlining), true + make_symbol_procedure_from_ast(ast_context, local.rhs, v.type^, node.name, {}, false, v.inlining), true } } else { return_symbol, ok = - make_symbol_procedure_from_ast(ast_context, local.rhs, v.type^, node, {}, false, v.inlining), true + make_symbol_procedure_from_ast(ast_context, local.rhs, v.type^, node.name, {}, false, v.inlining), true } case ^ast.Proc_Group: return_symbol, ok = resolve_function_overload(ast_context, v^) @@ -1725,7 +1725,7 @@ resolve_global_identifier :: proc(ast_context: ^AstContext, node: ast.Ident, glo ast_context, global.expr, v.type^, - node, + node.name, global.attributes, false, v.inlining, @@ -1738,7 +1738,7 @@ resolve_global_identifier :: proc(ast_context: ^AstContext, node: ast.Ident, glo ast_context, global.expr, v.type^, - node, + node.name, global.attributes, false, v.inlining, @@ -2865,16 +2865,20 @@ make_symbol_procedure_from_ast :: proc( ast_context: ^AstContext, n: ^ast.Node, v: ast.Proc_Type, - name: ast.Ident, + name: string, attributes: []^ast.Attribute, type: bool, inlining: ast.Proc_Inlining, ) -> Symbol { + pkg := "" + if n != nil { + pkg = get_package_from_node(n^) + } symbol := Symbol { - range = common.get_token_range(name, ast_context.file.src), + range = common.get_token_range(v, ast_context.file.src), type = .Function if !type else .Type_Function, - pkg = get_package_from_node(n^), - name = name.name, + pkg = pkg, + name = name, uri = common.create_uri(v.pos.file, ast_context.allocator).uri, } @@ -2893,7 +2897,7 @@ make_symbol_procedure_from_ast :: proc( } } - if expr, ok := ast_context.globals[name.name]; ok { + if expr, ok := ast_context.globals[name]; ok { if expr.deprecated { symbol.flags |= {.Distinct} } diff --git a/src/server/documentation.odin b/src/server/documentation.odin index bf5f44c..a2c00aa 100644 --- a/src/server/documentation.odin +++ b/src/server/documentation.odin @@ -662,6 +662,9 @@ write_node :: proc( case ^ast.Bit_Field_Type: symbol = make_symbol_bit_field_from_ast(ast_context, n, name, true) ok = true + case ^ast.Proc_Type: + symbol = make_symbol_procedure_from_ast(ast_context, nil, n^, name, {}, true, .None) + ok = true } if ok { if short_signature { |