Skip to content

Commit

Permalink
[REPLCompletions] follow up JuliaLang#43865, keep input tuple type in…
Browse files Browse the repository at this point in the history
… `MethodCompletion` (JuliaLang#43946)

`MethodCompletion.tt` is being used by an external consumer like Juno or
VSCode's runtime completion features to get additional information like
return type, etc.
  • Loading branch information
aviatesk authored and LilithHafner committed Mar 8, 2022
1 parent eb32feb commit a92ad85
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stdlib/REPL/src/REPLCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ struct FieldCompletion <: Completion
end

struct MethodCompletion <: Completion
tt # may be used by an external consumer to infer return type, etc.
method::Method
MethodCompletion(@nospecialize(tt), method::Method) = new(tt, method)
end

struct BslashCompletion <: Completion
Expand Down Expand Up @@ -617,7 +619,7 @@ function complete_methods!(out::Vector{Completion}, @nospecialize(funct), args_e
m isa Vector || return
for match in m
# TODO: if kwargs_ex, filter out methods without kwargs?
push!(out, MethodCompletion(match.method))
push!(out, MethodCompletion(match.spec_types, match.method))
end
end

Expand Down

0 comments on commit a92ad85

Please sign in to comment.