non-Jedi / eglot-jl

Wrapper for using Julia LanguageServer.jl with emacs eglot
Creative Commons Zero v1.0 Universal
62 stars 11 forks source link

"Connection state changed" :change "killed: 9" #45

Closed tamasgal closed 1 year ago

tamasgal commented 1 year ago

I need some help getting eglot working again. It worked for a while but now it keeps crashing and the buffer output does not really reveal (at least to me) a meaningful hint what's going wrong.

Julia 1.9.3
eglot: 1.15

  [2b0e0bc5] LanguageServer v4.4.0
  [cf896787] SymbolServer v7.2.1

This is what I get when I start eglot in my Doom Emacs setup, any ideas?

[stderr]   No Changes to `~/.julia/environments/v1.9/Project.toml`
[stderr]   No Changes to `~/.julia/environments/v1.9/Manifest.toml`
[stderr] [ Info: Environment successfully resolved
[stderr] nil
[stderr] nil
[stderr] nil
[stderr] Precompiling project...
[stderr]   ✓ Libmount_jll
[stderr] nil
[stderr]   ✓ Xorg_libXau_jll
[stderr]   ✓ Xorg_libXdmcp_jll
[stderr]   ✓ Imath_jll
[stderr]   ✓ Xorg_xtrans_jll
[stderr]   ✓ Xorg_libpthread_stubs_jll
[stderr]   ✓ Glib_jll
[stderr]   ✓ OpenEXR_jll
[stderr]   ✓ Xorg_libxcb_jll
[stderr]   ✓ Xorg_libX11_jll
[stderr] nil
[stderr]   ✓ Xorg_libXext_jll
[stderr]   ✓ Xorg_libXrender_jll
[stderr]   ✓ Xorg_libXfixes_jll
[stderr]   ✓ OpenEXR
[stderr]   ✓ Libglvnd_jll
[stderr]   ✓ Xorg_libXrandr_jll
[stderr]   ✓ Xorg_libXinerama_jll
[stderr]   ✓ Xorg_libXcursor_jll
[stderr] nil
[stderr]   ✓ Cairo_jll
[stderr]   ✓ Xorg_libXi_jll
[stderr]   ✓ ImageIO
[stderr]   ✓ GLFW_jll
[stderr]   ✓ HarfBuzz_jll
[stderr]   ✓ libass_jll
[stderr]   ✓ GLFW
[stderr]   ✓ FFMPEG_jll
[internal] Wed Sep 13 08:25:03 2023:
(:message "Connection state changed" :change "killed: 9\n")

----------b---y---e---b---y---e----------
[stderr] 
[stderr] 
[stderr] nil
[stderr] nil
[stderr] Process EGLOT (NeRCA.jl/(julia-mode julia-ts-mode)) stderr finished
ffevotte commented 1 year ago

Hmm, it looks like eglot-jl directly uses your default environment, when by default it should use a specific environment. What is the value of eglot-jl-language-server-project? Have you customized it?

tamasgal commented 1 year ago

Yes, I have set it to use my 1.9 environment but I already uncommented that line. It seems that it still picks that up. How do I force it to use the default one?

tamasgal commented 1 year ago

Sorry for my ignorance, just figure it out:

(after! eglot-jl
  (setq eglot-jl-language-server-project eglot-jl-base))

Still got an error:

           [(:uri "file:///Users/tamasgal/Dev/NeRCA.jl" :name "~/Dev/NeRCA.jl/")]))
[stderr]    Installed PrecompileTools ─ v1.1.1
[stderr]    Installed JuliaFormatter ── v1.0.31
[stderr]   No Changes to `~/.emacs.d/.local/straight/repos/eglot-jl/Project.toml`
[stderr]     Updating `~/.emacs.d/.local/straight/repos/eglot-jl/Manifest.toml`
[stderr]   [44cfe95a] ↑ Pkg v1.9.0 ⇒ v1.9.2
[stderr] [ Info: Environment successfully resolved
[stderr] nil
[stderr] Precompiling project...
[stderr]   ✓ Compat
[stderr]   ✓ PrecompileTools
[stderr]   ✓ DataStructures
[stderr]   ✓ Parsers
[stderr]   ✓ JSON
[stderr]   ✓ JSONRPC
[stderr]   ✓ CommonMark
[internal] Wed Sep 13 11:46:05 2023:
(:message "Connection state changed" :change "killed: 9\n")

----------b---y---e---b---y---e----------
[stderr] 
[stderr] 
[stderr] nil
[stderr] nil
[stderr] Process EGLOT (NeRCA.jl/(julia-mode julia-ts-mode)) stderr finished
ffevotte commented 1 year ago

Thanks! Now could you please try to see whether this environment seems to be working in an interactive process?

E.g. run these commands and please report back whether everything works:

$ julia --project=~/.emacs.d/.local/straight/repos/eglot-jl
julia> import Pkg
julia> Pkg.resolve()
julia> Pkg.instantiate()
julia> empty!(LOAD_PATH); push!(LOAD_PATH, "@")
julia> using LanguageServer
julia> using SymbolServer
tamasgal commented 1 year ago

OK, I'll note this debug procedure for the next time ;) resolve() helped, now it's working!