diff options
| -rw-r--r-- | src/server/analysis.odin | 5 | ||||
| -rw-r--r-- | tests/completions_test.odin | 26 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index f111c5d..8956c70 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -629,6 +629,11 @@ resolve_function_overload :: proc( call_expr := ast_context.call + //If there is nothing to resolve from, we actually want to get the invalid overloaded results through setting overloading to false + if call_expr == nil || len(call_expr.args) == 0 { + ast_context.overloading = false + } + candidates := make([dynamic]Symbol, context.temp_allocator) for arg_expr in group.args { diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 403ae51..76ed98a 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -266,6 +266,32 @@ ast_completion_identifier_proc_group :: proc(t: ^testing.T) { } @(test) +ast_completion_identifier_proc_group_2 :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + raw_data_slice :: proc(v: $T/[]$E) -> [^]E { + } + + zzcool :: proc { + raw_data_slice, + } + + main :: proc() { + zzco{*} + } + + `, + } + + test.expect_completion_details( + t, + &source, + "", + {"test.zzcool: proc(v: $T/[]$E) -> [^]E"}, + ) +} + +@(test) ast_completion_in_comp_lit_type :: proc(t: ^testing.T) { source := test.Source { main = `package test |