aboutsummaryrefslogtreecommitdiff
path: root/src/server/analysis.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-07 21:04:19 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-11 16:34:19 -0400
commit790cf8a16315d65bd80478aecfb34d7ff5dae31b (patch)
treec8f7e7ad40a9724fef3438a0832cb1c5791dfbbf /src/server/analysis.odin
parent03cbe19af2b3c74519be11c4de220eb9d36fa90d (diff)
Remove type information from the signature and write nested struct fields correctly
Diffstat (limited to 'src/server/analysis.odin')
-rw-r--r--src/server/analysis.odin32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 4401d5b..c5b9b29 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1048,13 +1048,13 @@ internal_resolve_type_expression :: proc(ast_context: ^AstContext, node: ^ast.Ex
return internal_resolve_type_expression(ast_context, v.values[0], out)
}
case ^Union_Type:
- out^, ok = make_symbol_union_from_ast(ast_context, v^, ast_context.field_name, true), true
+ out^, ok = make_symbol_union_from_ast(ast_context, v^, ast_context.field_name.name, true), true
return ok
case ^Enum_Type:
- out^, ok = make_symbol_enum_from_ast(ast_context, v^, ast_context.field_name, true), true
+ out^, ok = make_symbol_enum_from_ast(ast_context, v^, ast_context.field_name.name, true), true
return ok
case ^Struct_Type:
- out^, ok = make_symbol_struct_from_ast(ast_context, v, ast_context.field_name, {}, true), true
+ out^, ok = make_symbol_struct_from_ast(ast_context, v, ast_context.field_name.name, {}, true), true
return ok
case ^Bit_Set_Type:
out^, ok = make_symbol_bitset_from_ast(ast_context, v^, ast_context.field_name, true), true
@@ -1690,13 +1690,13 @@ resolve_local_identifier :: proc(ast_context: ^AstContext, node: ast.Ident, loca
case ^ast.Ident:
return_symbol, ok = internal_resolve_type_identifier(ast_context, v^)
case ^ast.Union_Type:
- return_symbol, ok = make_symbol_union_from_ast(ast_context, v^, node), true
+ return_symbol, ok = make_symbol_union_from_ast(ast_context, v^, node.name), true
return_symbol.name = node.name
case ^ast.Enum_Type:
- return_symbol, ok = make_symbol_enum_from_ast(ast_context, v^, node), true
+ return_symbol, ok = make_symbol_enum_from_ast(ast_context, v^, node.name), true
return_symbol.name = node.name
case ^ast.Struct_Type:
- return_symbol, ok = make_symbol_struct_from_ast(ast_context, v, node, {}), true
+ return_symbol, ok = make_symbol_struct_from_ast(ast_context, v, node.name, {}), true
return_symbol.name = node.name
case ^ast.Bit_Set_Type:
return_symbol, ok = make_symbol_bitset_from_ast(ast_context, v^, node), true
@@ -1790,16 +1790,16 @@ resolve_global_identifier :: proc(ast_context: ^AstContext, node: ast.Ident, glo
}
case ^ast.Struct_Type:
- return_symbol, ok = make_symbol_struct_from_ast(ast_context, v, node, global.attributes), true
+ return_symbol, ok = make_symbol_struct_from_ast(ast_context, v, node.name, global.attributes), true
return_symbol.name = node.name
case ^ast.Bit_Set_Type:
return_symbol, ok = make_symbol_bitset_from_ast(ast_context, v^, node), true
return_symbol.name = node.name
case ^ast.Union_Type:
- return_symbol, ok = make_symbol_union_from_ast(ast_context, v^, node), true
+ return_symbol, ok = make_symbol_union_from_ast(ast_context, v^, node.name), true
return_symbol.name = node.name
case ^ast.Enum_Type:
- return_symbol, ok = make_symbol_enum_from_ast(ast_context, v^, node), true
+ return_symbol, ok = make_symbol_enum_from_ast(ast_context, v^, node.name), true
return_symbol.name = node.name
case ^ast.Bit_Field_Type:
return_symbol, ok = make_symbol_bit_field_from_ast(ast_context, v, node), true
@@ -3151,14 +3151,14 @@ make_symbol_poly_type_from_ast :: proc(ast_context: ^AstContext, n: ^ast.Ident)
make_symbol_union_from_ast :: proc(
ast_context: ^AstContext,
v: ast.Union_Type,
- ident: ast.Ident,
+ name: string,
inlined := false,
) -> Symbol {
symbol := Symbol {
range = common.get_token_range(v, ast_context.file.src),
type = .Union,
pkg = get_package_from_node(v.node),
- name = ident.name,
+ name = name,
uri = common.create_uri(v.pos.file, ast_context.allocator).uri,
}
@@ -3198,13 +3198,13 @@ make_symbol_union_from_ast :: proc(
make_symbol_enum_from_ast :: proc(
ast_context: ^AstContext,
v: ast.Enum_Type,
- ident: ast.Ident,
+ name: string,
inlined := false,
) -> Symbol {
symbol := Symbol {
range = common.get_token_range(v, ast_context.file.src),
type = .Enum,
- name = ident.name,
+ name = name,
pkg = get_package_from_node(v.node),
uri = common.create_uri(v.pos.file, ast_context.allocator).uri,
}
@@ -3283,7 +3283,7 @@ make_symbol_bitset_from_ast :: proc(
make_symbol_struct_from_ast :: proc(
ast_context: ^AstContext,
v: ^ast.Struct_Type,
- ident: ast.Ident,
+ name: string,
attributes: []^ast.Attribute,
inlined := false,
) -> Symbol {
@@ -3292,7 +3292,7 @@ make_symbol_struct_from_ast :: proc(
range = common.get_token_range(v, ast_context.file.src),
type = .Struct,
pkg = get_package_from_node(v.node),
- name = ident.name,
+ name = name,
uri = common.create_uri(v.pos.file, ast_context.allocator).uri,
}
@@ -3302,7 +3302,7 @@ make_symbol_struct_from_ast :: proc(
}
b := symbol_struct_value_builder_make(symbol, ast_context.allocator)
- write_struct_type(ast_context, &b, v, ident, attributes, -1, inlined)
+ write_struct_type(ast_context, &b, v, attributes, -1, inlined)
symbol = to_symbol(b)
return symbol
}