aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-25 22:27:29 -0400
committerGitHub <noreply@github.com>2025-08-25 22:27:29 -0400
commita415dc91e9de80ee066540894e9b385330fad56b (patch)
tree71077d36d31600c1140aa2fb076107494e72efed /src/server
parent3e576e9eb5a9f6a79513ada7be541d01d5934477 (diff)
parent9482968c6f06792f4643c79a7ee8475bdd20e6dd (diff)
Merge pull request #932 from BradLewis/fix/comp-lit-default-param-completions
Fix completions with bit_set proc args with default values that specify the type with the comp lit
Diffstat (limited to 'src/server')
-rw-r--r--src/server/completion.odin8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin
index 617ffca..d54d03c 100644
--- a/src/server/completion.odin
+++ b/src/server/completion.odin
@@ -1302,8 +1302,14 @@ get_implicit_completion :: proc(
}
}
}
+ type := arg_type.type
+ if type == nil {
+ if comp_lit, ok := arg_type.default_value.derived.(^ast.Comp_Lit); ok {
+ type = comp_lit.type
+ }
+ }
- if enum_value, ok := unwrap_enum(ast_context, arg_type.type); ok {
+ if enum_value, ok := unwrap_enum(ast_context, type); ok {
for name in enum_value.names {
if position_context.comp_lit != nil &&
field_exists_in_comp_lit(position_context.comp_lit, name) {