@@ -139,6 +139,7 @@ let ex =
139139            kwtest4 (a:: SubString ; x23, _something) =  pass
140140            kwtest5 (a:: Int , b, x... ; somekwarg, somekotherkwarg) =  pass
141141            kwtest5 (a:: Char , b; xyz) =  pass
142+             kwtest6 (f:: Function , arg1; somekwarg) =  pass
142143
143144            const  named =  (; len2= 3 )
144145            const  fmsoebelkv =  (; len2= 3 )
@@ -198,6 +199,8 @@ test_scomplete(s) =  map_completion_text(@inferred(shell_completions(s, lastinde
198199test_complete_pos (s) =  map_completion_text (@inferred (completions (replace (s, ' |' =>  " " findfirst (' |' - 1 )))
199200test_complete_context (s, m= @__MODULE__ ; shift:: Bool = true ) = 
200201    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 (' |' - 1 , m, shift)))
201204test_complete_foo (s; shift:: Bool = true ) =  test_complete_context (s, Main. CompletionFoo; shift)
202205test_complete_noshift (s) =  map_completion_text (@inferred (completions (s, lastindex (s), Main, false )))
203206
@@ -2742,3 +2745,10 @@ let s = "for"
27422745    @test  " foreach" in  c
27432746    @test  ! (" rand" in  c)
27442747end 
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