diff --git a/src/requests/features.jl b/src/requests/features.jl index 9d232b64..1d42eb89 100644 --- a/src/requests/features.jl +++ b/src/requests/features.jl @@ -597,7 +597,7 @@ function get_inlay_parameter_hints(x::EXPR, server::LanguageServerInstance, doc, sigs = collect_signatures(x, doc, server) nargs = length(parentof(x).args) - 1 - nargs == 0 && return nothing + nargs < 2 && return nothing filter!(s -> length(s.parameters) == nargs, sigs) isempty(sigs) && return nothing @@ -613,15 +613,23 @@ function get_inlay_parameter_hints(x::EXPR, server::LanguageServerInstance, doc, if thisarg <= nargs && thisarg <= length(pars) label = pars[thisarg].label label == "#unused#" && return nothing + length(label) <= 2 && return nothing + CSTParser.str_value(x) == label && return nothing + x.head == :parameters && return nothing + if x.head isa CSTParser.EXPR && x.head.head == :OPERATOR && x.head.val == "." + if x.args[end] isa CSTParser.EXPR && x.args[end].args[end] isa CSTParser.EXPR + x.args[end].args[end].val == label && return nothing + end + end return InlayHint( Position(get_position_from_offset(doc, pos)...), - string(label, ':'), + string(label, "="), InlayHintKinds.Parameter, missing, pars[thisarg].documentation, false, - true, + false, missing ) end