Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/signature-help.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions test/test_signature_help.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading