diff --git a/src/signature-help.jl b/src/signature-help.jl index 1ef260b1d..dedd1a91f 100644 --- a/src/signature-help.jl +++ b/src/signature-help.jl @@ -357,9 +357,15 @@ function make_siginfo( # splat after semicolon maybe_var_kwp elseif kind(ca.args[active_arg]) in JS.KSet"= kw" || active_arg >= ca.kw_i - n = extract_kwarg_name(ca.args[active_arg]).name_val # we don't have a backwards mapping - out = get(kwp_map, n, nothing) - isnothing(out) ? maybe_var_kwp : out + kwname = extract_kwarg_name(ca.args[active_arg]) + # `extract_kwarg_name` returns `nothing` for unrecognized forms like `a.b=` + if isnothing(kwname) + maybe_var_kwp + else + # we don't have a backwards mapping + out = get(kwp_map, kwname.name_val, nothing) + isnothing(out) ? maybe_var_kwp : out + end else JETLS_DEBUG_LOWERING && @info "No active arg" active_arg ca.args[active_arg] nothing diff --git a/test/test_signature_help.jl b/test/test_signature_help.jl index e6fcdedde..1984d9409 100644 --- a/test/test_signature_help.jl +++ b/test/test_signature_help.jl @@ -267,6 +267,9 @@ end @test 6 == active_parameter(M_highlight, "f(kwfake=1│, 0, 1, 2, 3)") # # splat after semicolon @test 6 == active_parameter(M_highlight, "f(0, 1, 2, 3; kwfake...│)") + + # unrecognized kwarg forms should not crash and return something + @test siginfos(M_highlight, "f(0, 1, 2; a.b=1│)") isa Vector end module M_nested