@@ -35,6 +35,8 @@ const method_lookup_callback = Ref{Any}(nothing)
3535# a list of method-signatures defined by that expression.
3636const expressions_callback = Ref{Any}(nothing )
3737
38+ const juliabase = joinpath(" julia" , " base" )
39+ const juliastdlib = joinpath(" julia" , " stdlib" , " v$(VERSION . major) .$(VERSION . minor) " )
3840
3941# ## Public API
4042
@@ -112,6 +114,18 @@ Return the signatures of all methods whose definition spans the specified locati
112114Returns `nothing` if there are no methods at that location.
113115"""
114116function signatures_at(filename:: AbstractString , line:: Integer )
117+ if occursin(juliabase, filename)
118+ rpath = postpath(filename, juliabase)
119+ id = PkgId(Base)
120+ return signatures_at(id, rpath, line)
121+ elseif occursin(juliastdlib, filename)
122+ rpath = postpath(filename, juliastdlib)
123+ spath = splitpath(rpath)
124+ libname = spath[1 ]
125+ project = Base. active_project()
126+ id = PkgId(Base. project_deps_get(project, libname), libname)
127+ return signatures_at(id, joinpath(spath[2 : end ]. .. ), line)
128+ end
115129 for (id, pkgfls) in _pkgfiles
116130 if startswith(filename, basedir(pkgfls)) || id. name == " Main"
117131 bdir = basedir(pkgfls)
0 commit comments