aboutsummaryrefslogtreecommitdiff
path: root/src/server/symbol.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-23 09:38:10 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-24 08:55:23 -0400
commit0d7f28a8ca38fbdd4baa522ec1caf9316d090d19 (patch)
treef191c7139e18154e556bb8742eb1cc0cafa1e118 /src/server/symbol.odin
parente239a9a74e732d91cc3e7e1c4b2dc68da1f2cb4c (diff)
Check types before adding pointer completion
Diffstat (limited to 'src/server/symbol.odin')
-rw-r--r--src/server/symbol.odin31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/server/symbol.odin b/src/server/symbol.odin
index 3e97fba..e87cb70 100644
--- a/src/server/symbol.odin
+++ b/src/server/symbol.odin
@@ -204,19 +204,20 @@ SymbolFlag :: enum {
SymbolFlags :: bit_set[SymbolFlag]
Symbol :: struct {
- range: common.Range, //the range of the symbol in the file
- uri: string, //uri of the file the symbol resides
- pkg: string, //absolute directory path where the symbol resides
- name: string, //name of the symbol
- doc: string,
- comment: string,
- signature: string, //type signature
- type: SymbolType,
- type_pkg: string,
- type_name: string,
- value: SymbolValue,
- pointers: int, //how many `^` are applied to the symbol
- flags: SymbolFlags,
+ range: common.Range, //the range of the symbol in the file
+ uri: string, //uri of the file the symbol resides
+ pkg: string, //absolute directory path where the symbol resides
+ name: string, //name of the symbol
+ doc: string,
+ comment: string,
+ signature: string, //type signature
+ type: SymbolType,
+ parent_name: string, // When symbol is a field, this is the name of the parent symbol it is a field of
+ type_pkg: string,
+ type_name: string,
+ value: SymbolValue,
+ pointers: int, //how many `^` are applied to the symbol
+ flags: SymbolFlags,
}
SymbolType :: enum {
@@ -846,8 +847,8 @@ construct_struct_field_symbol :: proc(symbol: ^Symbol, parent_name: string, valu
symbol.type_pkg = symbol.pkg
symbol.type_name = symbol.name
symbol.name = value.names[index]
- symbol.pkg = parent_name
symbol.type = .Field
+ symbol.parent_name = parent_name
symbol.doc = get_doc(value.types[index], value.docs[index], context.temp_allocator)
symbol.comment = get_comment(value.comments[index])
}
@@ -859,7 +860,7 @@ construct_bit_field_field_symbol :: proc(
index: int,
) {
symbol.name = value.names[index]
- symbol.pkg = parent_name
+ symbol.parent_name = parent_name
symbol.type = .Field
symbol.doc = get_doc(value.types[index], value.docs[index], context.temp_allocator)
symbol.comment = get_comment(value.comments[index])