Skip to content

Commit 5367aa5

Browse files
authored
Merge pull request #300 from julia-vscode/sp/rm-pkgentry
fix: don't depend on PkgEntry for empty dicts in get_general_pkgs
2 parents b261ae7 + 4b6f751 commit 5367aa5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/SymbolServer.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ function get_general_pkgs()
4343
@static if VERSION >= v"1.7-"
4444
regs = Pkg.Types.Context().registries
4545
i = findfirst(r -> r.name == "General" && r.uuid == GENERAL_REGISTRY_UUID, regs)
46-
i === nothing && return Dict{UUID, PkgEntry}()
46+
i === nothing && return Dict()
4747
return regs[i].pkgs
4848
else
4949
for r in Pkg.Types.collect_registries()
5050
(r.name == "General" && r.uuid == GENERAL_REGISTRY_UUID) || continue
5151
reg = Pkg.Types.read_registry(joinpath(r.path, "Registry.toml"))
5252
return reg["packages"]
5353
end
54-
return Dict{UUID, PkgEntry}()
54+
return Dict()
5555
end
5656
finally
5757
append!(empty!(Base.DEPOT_PATH), dp_before)

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,13 +628,13 @@ function load_package(c::Pkg.Types.Context, uuid, conn, loadingbay, percentage =
628628
if pid in keys(Base.loaded_modules)
629629
conn !== nothing && println(conn, "PROCESSPKG;$pe_name;$uuid;noversion;$percentage")
630630
loadingbay.eval(:($(Symbol(pe_name)) = $(Base.loaded_modules[pid])))
631-
m = invokelatest(() -> getfield(loadingbay, Symbol(pe_name)))
631+
m = Base.invokelatest(() -> getfield(loadingbay, Symbol(pe_name)))
632632
else
633633
m = try
634634
conn !== nothing && println(conn, "STARTLOAD;$pe_name;$uuid;noversion;$percentage")
635635
loadingbay.eval(:(import $(Symbol(pe_name))))
636636
conn !== nothing && println(conn, "STOPLOAD;$pe_name")
637-
m = invokelatest(() -> getfield(loadingbay, Symbol(pe_name)))
637+
m = Base.invokelatest(() -> getfield(loadingbay, Symbol(pe_name)))
638638
catch
639639
return
640640
end

0 commit comments

Comments
 (0)