SymbolServer.jl icon indicating copy to clipboard operation
SymbolServer.jl copied to clipboard

Fix UndefVarError for PkgEntry

Open visr opened this issue 10 months ago • 2 comments

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

visr avatar Feb 25 '25 10:02 visr

Thanks!

pfitzseb avatar Feb 25 '25 10:02 pfitzseb

@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

flexagoon avatar Mar 03 '25 18:03 flexagoon

Would be great to have this merged.

visr avatar May 06 '25 21:05 visr

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

pfitzseb avatar May 07 '25 06:05 pfitzseb

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?

visr avatar May 20 '25 14:05 visr