From 6eccf0bb2540ae17ee1a1e448325ababd3b14611 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Tue, 5 Mar 2019 09:10:05 -0600 Subject: [PATCH] Support files associated with Main Revise's `includet` associates these with Main and via absolute path --- src/CodeTracking.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CodeTracking.jl b/src/CodeTracking.jl index dcb7378..f59ff59 100644 --- a/src/CodeTracking.jl +++ b/src/CodeTracking.jl @@ -79,8 +79,12 @@ Returns `nothing` if there are no methods at that location. """ function signatures_at(filename::AbstractString, line::Integer) for (id, pkgfls) in _pkgfiles - if startswith(filename, basedir(pkgfls)) - return signatures_at(id, relpath(filename, basedir(pkgfls)), line) + if startswith(filename, basedir(pkgfls)) || id.name == "Main" + bdir = basedir(pkgfls) + rpath = isempty(bdir) ? filename : relpath(filename, bdir) + if rpath ∈ pkgfls.files + return signatures_at(id, rpath, line) + end end end error("$filename not found, perhaps the package is not loaded")