@@ -139,6 +139,7 @@ let ex =
139
139
kwtest4 (a:: SubString ; x23, _something) = pass
140
140
kwtest5 (a:: Int , b, x... ; somekwarg, somekotherkwarg) = pass
141
141
kwtest5 (a:: Char , b; xyz) = pass
142
+ kwtest6 (f:: Function , arg1; somekwarg) = pass
142
143
143
144
const named = (; len2= 3 )
144
145
const fmsoebelkv = (; len2= 3 )
@@ -198,6 +199,8 @@ test_scomplete(s) = map_completion_text(@inferred(shell_completions(s, lastinde
198
199
test_complete_pos (s) = map_completion_text (@inferred (completions (replace (s, ' |' => " " ), findfirst (' |' , s)- 1 )))
199
200
test_complete_context (s, m= @__MODULE__ ; shift:: Bool = true ) =
200
201
map_completion_text (@inferred (completions (s,lastindex (s), m, shift)))
202
+ test_complete_context_pos (s, m= @__MODULE__ ; shift:: Bool = true ) =
203
+ map_completion_text (@inferred (completions (replace (s, ' |' => " " ), findfirst (' |' , s)- 1 , m, shift)))
201
204
test_complete_foo (s; shift:: Bool = true ) = test_complete_context (s, Main. CompletionFoo; shift)
202
205
test_complete_noshift (s) = map_completion_text (@inferred (completions (s, lastindex (s), Main, false )))
203
206
@@ -2742,3 +2745,10 @@ let s = "for"
2742
2745
@test " foreach" in c
2743
2746
@test ! (" rand" in c)
2744
2747
end
2748
+
2749
+ # #58833 - Autocompletion of keyword arguments with do-blocks is broken
2750
+ let s = " kwtest6(123; som|) do x; x + 3 end"
2751
+ c, r = test_complete_context_pos (s, Main. CompletionFoo)
2752
+ @test " somekwarg=" in c
2753
+ @test r == 14 : 16
2754
+ end
0 commit comments