Skip to content
Merged
Show file tree
Hide file tree
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
38 changes: 18 additions & 20 deletions ext/REPLExt/completions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,30 @@ function complete_remote_package!(comps, partial; hint::Bool)
name = regpkg.name
name in cmp && continue
if startswith(regpkg.name, partial)
pkg = Registry.registry_info(regpkg)
pkg = Registry.registry_info(reg, regpkg)
Registry.isdeprecated(pkg) && continue
compat_info = Registry.compat_info(pkg)
# Filter versions
for (v, uncompressed_compat) in compat_info
# Check if any non-yanked version is compatible with current Julia
found_compatible_version = false
for v in keys(pkg.version_info)
Registry.isyanked(pkg, v) && continue
# TODO: Filter based on offline mode
is_julia_compat = nothing
for (pkg_uuid, vspec) in uncompressed_compat
if pkg_uuid == JULIA_UUID
is_julia_compat = VERSION in vspec
is_julia_compat && continue
end
end
# Found a compatible version or compat on julia at all => compatible
if is_julia_compat === nothing || is_julia_compat
push!(cmp, name)
# In hint mode the result is only used if there is a single matching entry
# so we can return no matches in case of more than one match
if hint && found_match
return true # true means returned early
end
found_match = true
# Query compressed compat for this version (optimized: only fetch Julia compat)
julia_vspec = Pkg.Registry.query_compat_for_version(pkg, v, JULIA_UUID)
# Found a compatible version or no julia compat at all => compatible
if julia_vspec === nothing || VERSION in julia_vspec
found_compatible_version = true
break
end
end
if found_compatible_version
push!(cmp, name)
# In hint mode the result is only used if there is a single matching entry
# so we can return no matches in case of more than one match
if hint && found_match
return true # true means returned early
end
found_match = true
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/Apps/Apps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function get_max_version_register(pkg::PackageSpec, regs)
if get(reg, pkg.uuid, nothing) !== nothing
reg_pkg = get(reg, pkg.uuid, nothing)
reg_pkg === nothing && continue
pkg_info = Registry.registry_info(reg_pkg)
pkg_info = Registry.registry_info(reg, reg_pkg)
for (version, info) in pkg_info.version_info
info.yanked && continue
if pkg.version isa VersionNumber
Expand Down
220 changes: 132 additions & 88 deletions src/Operations.jl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ include("GitTools.jl")
include("PlatformEngines.jl")
include("Versions.jl")
include("Registry/Registry.jl")
include("Resolve/Resolve.jl")
include("Types.jl")
include("Resolve/Resolve.jl")
include("BinaryPlatformsCompat.jl")
include("Artifacts.jl")
const Artifacts = PkgArtifacts
Expand Down
Loading