@@ -78,32 +78,30 @@ function complete_remote_package!(comps, partial; hint::Bool)
7878 name = regpkg. name
7979 name in cmp && continue
8080 if startswith (regpkg. name, partial)
81- pkg = Registry. registry_info (regpkg)
81+ pkg = Registry. registry_info (reg, regpkg)
8282 Registry. isdeprecated (pkg) && continue
83- compat_info = Registry . compat_info (pkg)
84- # Filter versions
85- for (v, uncompressed_compat) in compat_info
83+ # Check if any non-yanked version is compatible with current Julia
84+ found_compatible_version = false
85+ for v in keys (pkg . version_info)
8686 Registry. isyanked (pkg, v) && continue
8787 # TODO : Filter based on offline mode
88- is_julia_compat = nothing
89- for (pkg_uuid, vspec) in uncompressed_compat
90- if pkg_uuid == JULIA_UUID
91- is_julia_compat = VERSION in vspec
92- is_julia_compat && continue
93- end
94- end
95- # Found a compatible version or compat on julia at all => compatible
96- if is_julia_compat === nothing || is_julia_compat
97- push! (cmp, name)
98- # In hint mode the result is only used if there is a single matching entry
99- # so we can return no matches in case of more than one match
100- if hint && found_match
101- return true # true means returned early
102- end
103- found_match = true
88+ # Query compressed compat for this version (optimized: only fetch Julia compat)
89+ julia_vspec = Pkg. Registry. query_compat_for_version (pkg, v, JULIA_UUID)
90+ # Found a compatible version or no julia compat at all => compatible
91+ if julia_vspec === nothing || VERSION in julia_vspec
92+ found_compatible_version = true
10493 break
10594 end
10695 end
96+ if found_compatible_version
97+ push! (cmp, name)
98+ # In hint mode the result is only used if there is a single matching entry
99+ # so we can return no matches in case of more than one match
100+ if hint && found_match
101+ return true # true means returned early
102+ end
103+ found_match = true
104+ end
107105 end
108106 end
109107 end
0 commit comments