diff options
| author | Bradley Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-12-01 18:06:51 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-01 18:06:51 +1100 |
| commit | 0cf7f19eb147ae20c7427395397a08627de23264 (patch) | |
| tree | 7fc5d10f1096b1114fc2c95d780584784ba13ef6 | |
| parent | 0b947ef026af9e41e06ac7790b5c67c29c827dd3 (diff) | |
| parent | 52462cf8f9f93cc5f01275cbb404b3c2af323ac2 (diff) | |
Merge pull request #1199 from BradLewis/fix/implicit-selector-completion-binary-expr-improvements
| -rw-r--r-- | src/server/completion.odin | 2 | ||||
| -rw-r--r-- | tests/completions_test.odin | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin index 8560ed3..8a0f371 100644 --- a/src/server/completion.odin +++ b/src/server/completion.odin @@ -1345,7 +1345,7 @@ get_implicit_completion :: proc( if position_context.binary != nil { #partial switch position_context.binary.op.kind { - case .Cmp_Eq, .Not_Eq, .In, .Not_In: + case .Cmp_Eq, .Not_Eq, .In, .Not_In, .Lt, .Lt_Eq, .Gt, .Gt_Eq: context_node: ^ast.Expr enum_node: ^ast.Expr diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 92fd332..72dcb86 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -5113,3 +5113,20 @@ ast_completion_implicit_selector_enumerated_array_in_proc_call_arg :: proc(t: ^t } test.expect_completion_docs(t, &source, "", {"A1", "A2"}) } + +@(test) +ast_completion_implicit_selector_binary_expr :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Foo :: enum { + A, + B, + } + main :: proc() { + foo: Foo + if foo < .{*} + } + `, + } + test.expect_completion_docs(t, &source, "", {"A", "B"}) +} |