aboutsummaryrefslogtreecommitdiff
path: root/src/server/symbol.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-23 20:28:26 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-29 15:49:10 -0400
commit9613b53f7daef02146be6114288a37487e997803 (patch)
tree867827687be9ee45117931cc840a9c942f6b614e /src/server/symbol.odin
parent6c769f52ffd2cd40def26f758498ca4a8b2bce2b (diff)
Create constructors for field symbols
Diffstat (limited to 'src/server/symbol.odin')
-rw-r--r--src/server/symbol.odin29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/server/symbol.odin b/src/server/symbol.odin
index fa6fbbf..6478b0e 100644
--- a/src/server/symbol.odin
+++ b/src/server/symbol.odin
@@ -767,3 +767,32 @@ symbol_to_expr :: proc(symbol: Symbol, file: string, allocator := context.temp_a
return nil
}
+
+// TODO: these will need ranges of the fields as well
+construct_struct_field_symbol :: proc(symbol: ^Symbol, parent_name: string, value: SymbolStructValue, index: int) {
+ symbol.type_pkg = symbol.pkg
+ symbol.type_name = symbol.name
+ symbol.name = value.names[index]
+ symbol.pkg = parent_name
+ symbol.type = .Field
+ symbol.doc = get_doc(value.docs[index], context.temp_allocator)
+ symbol.comment = get_comment(value.comments[index])
+}
+
+construct_bit_field_field_symbol :: proc(symbol: ^Symbol, parent_name: string, value: SymbolBitFieldValue, index: int) {
+ symbol.type_pkg = symbol.pkg
+ symbol.type_name = symbol.name
+ symbol.name = value.names[index]
+ symbol.pkg = parent_name
+ symbol.type = .Field
+ symbol.doc = get_doc(value.docs[index], context.temp_allocator)
+ symbol.comment = get_comment(value.comments[index])
+ build_bit_field_field_documentation(symbol, value, index)
+}
+
+construct_enum_field_symbol :: proc(symbol: ^Symbol, value: SymbolEnumValue, index: int) {
+ symbol.type = .Field
+ //symbol.doc = get_doc(value.docs[index], context.temp_allocator)
+ //symbol.comment = get_comment(value.comments[index])
+ symbol.signature = get_enum_field_signature(value, index)
+}