aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-11 21:12:31 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-11 21:12:31 -0400
commite90a29ed4682530243e10ae91e880ed2eeba4dfd (patch)
treed081166740bd969c3caa811f5b05b2993eb7b39e /src
parent968712e40186abaf5447f69cc73b197af9d94600 (diff)
Correctly resolve go to definition for nested using bitfields on structs
Diffstat (limited to 'src')
-rw-r--r--src/server/analysis.odin2
-rw-r--r--src/server/symbol.odin9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 4f70fbd..7538fe1 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -3432,7 +3432,7 @@ make_symbol_struct_from_ast :: proc(
}
b := symbol_struct_value_builder_make(symbol, ast_context.allocator)
- write_struct_type(ast_context, &b, v, attributes, -1, inlined)
+ write_struct_type(ast_context, &b, v, attributes, -1)
symbol = to_symbol(b)
return symbol
}
diff --git a/src/server/symbol.odin b/src/server/symbol.odin
index 3d176f1..f140694 100644
--- a/src/server/symbol.odin
+++ b/src/server/symbol.odin
@@ -378,7 +378,6 @@ write_struct_type :: proc(
v: ^ast.Struct_Type,
attributes: []^ast.Attribute,
base_using_index: int,
- inlined := false,
) {
b.poly = v.poly_params
// We clone this so we don't override docs and comments with temp allocated docs and comments
@@ -542,7 +541,7 @@ expand_usings :: proc(ast_context: ^AstContext, b: ^SymbolStructValueBuilder) {
if ident, ok := derived.(^ast.Ident); ok {
if v, ok := struct_type_from_identifier(ast_context, ident^); ok {
- write_struct_type(ast_context, b, v, {}, u, true)
+ write_struct_type(ast_context, b, v, {}, u)
} else {
clear(&ast_context.recursion_map)
if symbol, ok := resolve_type_identifier(ast_context, ident^); ok {
@@ -563,6 +562,12 @@ expand_usings :: proc(ast_context: ^AstContext, b: ^SymbolStructValueBuilder) {
}
} else if v, ok := derived.(^ast.Struct_Type); ok {
write_struct_type(ast_context, b, v, {}, u)
+ } else if v, ok := derived.(^ast.Bit_Field_Type); ok {
+ if symbol, ok := resolve_type_expression(ast_context, field_expr); ok {
+ if v, ok := symbol.value.(SymbolBitFieldValue); ok {
+ write_symbol_bitfield_value(ast_context, b, v, u)
+ }
+ }
}
delete_key(&ast_context.recursion_map, b.types[u])
}