diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-12 20:06:30 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-12 20:06:30 -0400 |
| commit | 0703d58d1823fcaebb4b7d302b2bc6f8c9cc941e (patch) | |
| tree | 16898766192b38046631b32c8479c0c70c299dc5 /src | |
| parent | 8f626259507c4f6534dba4bc863dabbe30cee440 (diff) | |
Correctly resolve completions for comp lit map with enum keys and values
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/analysis.odin | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index e9e5d30..ef97a80 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -2031,6 +2031,15 @@ resolve_implicit_selector_comp_literal :: proc( // .valueTwo = 2, //} return resolve_type_expression(ast_context, v.len) + case SymbolMapValue: + for elem in comp_lit.elems { + if position_in_node(elem, position_context.position) { + if _, ok := elem.derived.(^ast.Field_Value); ok { + return resolve_type_expression(ast_context, v.value) + } + return resolve_type_expression(ast_context, v.key) + } + } } } return {}, false |