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
11 changes: 7 additions & 4 deletions src/CodeTracking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,13 @@ Returns `nothing` if this package has not been loaded.
pkgfiles(name::AbstractString, uuid::UUID) = pkgfiles(PkgId(uuid, name))
function pkgfiles(name::AbstractString)
project = Base.active_project()
# The value returned by Base.project_deps_get depends on the Julia version
id = isdefined(Base, :TOMLCache) && Base.VERSION < v"1.6.0-DEV.1180" ? Base.project_deps_get(project, name, Base.TOMLCache()) :
Base.project_deps_get(project, name)
(id == false || id === nothing) && error("no package ", name, " recognized")
@static if VERSION ≥ v"1.14.0-DEV.13"
id = Base.package_get_here(project, name)
id.uuid === nothing && error("no package ", name, " recognized")
else
id = Base.project_deps_get(project, name)
id === nothing && error("no package ", name, " recognized")
end
return isa(id, PkgId) ? pkgfiles(id) : pkgfiles(name, id)
end
pkgfiles(id::PkgId) = get(_pkgfiles, id, nothing)
Expand Down
Loading