Skip to content
Merged
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
6 changes: 4 additions & 2 deletions src/CodeTracking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Return the file and line of the definition of `method`. `line`
is the first line of the method's body.
"""
function whereis(method::Method)
file, line = String(method.file), method.line
startswith(file, "REPL[") && return file, line
lin = get(method_info, method.sig, nothing)
if lin === nothing
f = method_lookup_callback[]
Expand All @@ -60,7 +62,6 @@ function whereis(method::Method)
end
end
if lin === nothing || ismissing(lin)
file, line = String(method.file), method.line
else
file, line = fileline(lin[1])
end
Expand Down Expand Up @@ -224,7 +225,8 @@ end
Return an expression that defines `method`.
"""
function definition(::Type{Expr}, method::Method)
def = get(method_info, method.sig, nothing)
file = String(method.file)
def = startswith(file, "REPL[") ? nothing : get(method_info, method.sig, nothing)
if def === nothing
f = method_lookup_callback[]
if f !== nothing
Expand Down