diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-10-19 16:29:29 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-10-19 16:29:29 -0400 |
| commit | d20a655e0ea50f30c215a106ab512fab25dfedbb (patch) | |
| tree | 421106b6f64558f64072d5f936bd16038058e588 /src | |
| parent | 38e01b2aef7001794b28f1f53e6d5cea1644cbc6 (diff) | |
Add identifier completions for array-like comp lits
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/completion.odin | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin index edf6578..5d39109 100644 --- a/src/server/completion.odin +++ b/src/server/completion.odin @@ -154,7 +154,7 @@ get_completion_list :: proc( // TODO: as these are mutally exclusive, should probably just make them return a slice? switch completion_type { case .Comp_Lit: - is_incomplete = get_comp_lit_completion(&ast_context, &position_context, &results) + is_incomplete = get_comp_lit_completion(&ast_context, &position_context, &results, config) case .Identifier: is_incomplete = get_identifier_completion(&ast_context, &position_context, &results, config) case .Implicit: @@ -646,6 +646,7 @@ get_comp_lit_completion :: proc( ast_context: ^AstContext, position_context: ^DocumentPositionContext, results: ^[dynamic]CompletionResult, + config: ^common.Config, ) -> bool { if symbol, ok := resolve_comp_literal(ast_context, position_context); ok { #partial switch v in symbol.value { @@ -666,6 +667,7 @@ get_comp_lit_completion :: proc( append(results, CompletionResult{symbol = resolved}) } } + return false case SymbolBitFieldValue: for name, i in v.names { if name == "_" { @@ -683,6 +685,7 @@ get_comp_lit_completion :: proc( append(results, CompletionResult{symbol = resolved}) } } + return false case SymbolFixedArrayValue: if symbol, ok := resolve_type_expression(ast_context, v.len); ok { if v, ok := symbol.value.(SymbolEnumValue); ok { @@ -694,9 +697,11 @@ get_comp_lit_completion :: proc( construct_enum_field_symbol(&symbol, v, i) append(results, CompletionResult{symbol = symbol}) } + return false } } } + return get_identifier_completion(ast_context, position_context, results, config) } return false |