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

Language server fails to start in Zed editor.

Open curioustolearn opened this issue 8 months ago • 2 comments

Hello,

Recently after I changed my Julia version to 1.10.4 to work on an older project, the language server stopped working. Here is the error I get for why the language-server does not start. I reinstalled language server from the REPL, but still get the error below. Any ideas how I can get it working.

Thank you.

Language server error: julia

initializing server julia, id 4
-- stderr--
ERROR: MethodError: no method matching project_rel_path(::Pkg.Types.EnvCache, ::Nothing)

Closest candidates are:
  project_rel_path(::Pkg.Types.EnvCache, !Matched::String)
   @ Pkg ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:922

Stacktrace:
  [1] package_info(env::Pkg.Types.EnvCache, pkg::Pkg.Types.PackageSpec, entry::Pkg.Types.PackageEntry)
    @ Pkg.API ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:68
  [2] package_info
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:61 [inlined]
  [3] #9
    @ ./none:0 [inlined]
  [4] iterate
    @ ./generator.jl:47 [inlined]
  [5] _all(f::Base.var"#384#386", itr::Base.Generator{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}}, ::Colon)
    @ Base ./reduce.jl:1297
  [6] all
    @ ./reduce.jl:1283 [inlined]
  [7] Dict(kv::Base.Generator{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}})
    @ Base ./dict.jl:111
  [8] dependencies
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:88 [inlined]
  [9] dependencies()
    @ Pkg.API ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:85
 [10] top-level scope
    @ none:5

caused by: MethodError: no method matching project_rel_path(::Pkg.Types.EnvCache, ::Nothing)

Closest candidates are:
  project_rel_path(::Pkg.Types.EnvCache, !Matched::String)
   @ Pkg ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:922

Stacktrace:
  [1] package_info(env::Pkg.Types.EnvCache, pkg::Pkg.Types.PackageSpec, entry::Pkg.Types.PackageEntry)
    @ Pkg.API ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:68
  [2] package_info
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:61 [inlined]
  [3] #9
    @ ./none:0 [inlined]
  [4] iterate
    @ ./generator.jl:47 [inlined]
  [5] Dict{Base.UUID, Pkg.API.PackageInfo}(kv::Base.Generator{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}})
    @ Base ./dict.jl:85
  [6] dict_with_eltype
    @ ./abstractdict.jl:581 [inlined]
  [7] dict_with_eltype
    @ ./abstractdict.jl:588 [inlined]
  [8] Dict(kv::Base.Generator{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}})
    @ Base ./dict.jl:109
  [9] dependencies
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:88 [inlined]
 [10] dependencies()
    @ Pkg.API ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:85
 [11] top-level scope
    @ none:5

curioustolearn avatar Jun 05 '25 14:06 curioustolearn

I have much the same error, with Julia 1.11.7 (although it's not new).

This issue https://github.com/JuliaLang/Pkg.jl/issues/3404 says it may be something to do with versions of std. lib. packages not matching some manifest? But not really sure what environment things are being run in.

Language server julia:

initializing server julia, id 35: Server reset the connection
-- stderr --
ERROR: MethodError: no method matching project_rel_path(::Pkg.Types.EnvCache, ::Nothing)
The function `project_rel_path` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  project_rel_path(::Pkg.Types.EnvCache, !Matched::String)
   @ Pkg ~/.julia/juliaup/julia-1.11.7+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:960

Stacktrace:
  [1] package_info(env::Pkg.Types.EnvCache, pkg::Pkg.Types.PackageSpec, entry::Pkg.Types.PackageEntry)
    @ Pkg.API ~/.julia/juliaup/julia-1.11.7+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Pkg/src/API.jl:66
  [2] package_info
    @ ~/.julia/juliaup/julia-1.11.7+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Pkg/src/API.jl:59 [inlined]
  [3] #9
    @ ./none:0 [inlined]
  [4] iterate
    @ ./generator.jl:48 [inlined]
  [5] Dict{Base.UUID, Pkg.API.PackageInfo}(kv::Base.Generator{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}})
    @ Base ./dict.jl:95
  [6] dict_with_eltype
    @ ./abstractdict.jl:636 [inlined]
  [7] dict_with_eltype
    @ ./abstractdict.jl:643 [inlined]
  [8] Dict
    @ ./dict.jl:117 [inlined]
  [9] dependencies
    @ ~/.julia/juliaup/julia-1.11.7+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Pkg/src/API.jl:86 [inlined]
 [10] dependencies()
    @ Pkg.API ~/.julia/juliaup/julia-1.11.7+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Pkg/src/API.jl:83
 [11] top-level scope
    @ none:5

mcabbott avatar Nov 09 '25 23:11 mcabbott

I think this basically is https://github.com/JuliaEditorSupport/zed-julia/issues/50. That extension should be shipping a full environment instead of relying this.

Related: https://github.com/julia-vscode/LanguageServer.jl/issues/1366.

pfitzseb avatar Nov 10 '25 12:11 pfitzseb