Skip to content

Commit

Permalink
[REPLCompletions] follow up #43865, keep input tuple type in `MethodC…
Browse files Browse the repository at this point in the history
…ompletion`

`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.

Co-Authored-By: Jameson Nash <[email protected]>
  • Loading branch information
aviatesk and vtjnash committed Jan 27, 2022
1 parent 9868411 commit 4cd2c98
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 4cd2c98

Please sign in to comment.