Fix UndefVarError for PkgEntry
Fixes #294, avoids always processing all packages locally when using a custom JULIA_DEPOT_PATH.
The language server showed this log:
┌ Error: Symbol cache downloading: Failed to identify which packages to omit based on the General registry.
│ All packages will be processsed locally
│ err =
│ UndefVarError: `PkgEntry` not defined in `SymbolServer`
│ Suggestion: check for spelling errors or missing imports.
└ @ SymbolServer
This UndefVarError lead to always erroring on the side of caution as mentioned here:
https://github.com/julia-vscode/SymbolServer.jl/blob/2201c26a43013a7bf71b4829ee4967e072070cab/src/SymbolServer.jl#L114-L122
Thanks!
@pfitzseb could you please merge this? The issue also has a side effect of always writing Pkg logs to ~/.julia regardless of the depot path, so it's pretty annoying
Would be great to have this merged.
This doesn't actually fix the issue on 1.6 or earlier:
julia> VERSION
v"1.6.7"
julia> using Pkg.Registry: PkgEntry
ERROR: UndefVarError: PkgEntry not defined
Ok I've addressed that now.
Running this code locally still results in get_general_pkgs() being empty since my depot isn't in my homedir. I guess that means this doesn't fix #294, just a surface issue on top?
See also this discussion: https://github.com/julia-vscode/SymbolServer.jl/pull/263#discussion_r1097282808
How can we better find the General registry?