Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Julia language server cannot go up #46

Closed
roiholtzman opened this issue Mar 18, 2021 · 8 comments
Closed

The Julia language server cannot go up #46

roiholtzman opened this issue Mar 18, 2021 · 8 comments

Comments

@roiholtzman
Copy link

I have posted this issue on the emacs-lsp project, but maybe it's related to lsp-julia.

This is the content of the issue:
The Julia language server, lsp-julia cannot start.

I use doom emacs on MacOS. I upgraded doom and the problem continues.
A surprising thing is that initially everything worked great. Then I restarted emacs and the problem appeared. Using some help on discord I upgraded doom emacs, but still things are not working.

The error from Julia-ls::stderr:

ERROR: MethodError: no method matching LanguageServer.FoldingRangeClientCapabilities(::Nothing)
Closest candidates are:
  LanguageServer.FoldingRangeClientCapabilities(::Any, !Matched::Any, !Matched::Any) at /Users/roiholtzman/.julia/packages/LanguageServer/y1ebo/src/protocol/features.jl:217
  LanguageServer.FoldingRangeClientCapabilities(; dynamicRegistration, rangeLimit, lineFoldingOnly) at /Users/roiholtzman/.julia/packages/JSONRPC/xbAlZ/src/interface_def.jl:50
  LanguageServer.FoldingRangeClientCapabilities(!Matched::Union{Missing, Bool}, !Matched::Union{Missing, Int64}, !Matched::Union{Missing, Bool}) at /Users/roiholtzman/.julia/packages/LanguageServer/y1ebo/src/protocol/features.jl:217
  ...
Stacktrace:
 [1] LanguageServer.TextDocumentClientCapabilities(::Dict{String,Any}) at /Users/roiholtzman/.julia/packages/JSONRPC/xbAlZ/src/interface_def.jl:56
 [2] LanguageServer.ClientCapabilities(::Dict{String,Any}) at /Users/roiholtzman/.julia/packages/JSONRPC/xbAlZ/src/interface_def.jl:56
 [3] LanguageServer.InitializeParams(::Dict{String,Any}) at /Users/roiholtzman/.julia/packages/LanguageServer/y1ebo/src/protocol/initialize.jl:111
 [4] dispatch_msg(::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint,Base.PipeEndpoint}, ::JSONRPC.MsgDispatcher, ::Dict{String,Any}) at /Users/roiholtzman/.julia/packages/JSONRPC/xbAlZ/src/typed.jl:64
 [5] run(::LanguageServerInstance) at /Users/roiholtzman/.julia/packages/LanguageServer/y1ebo/src/languageserverinstance.jl:308
 [6] top-level scope at none:1

Process julia-ls stderr finished

in the lsp-log there is:

Command "julia --startup-file=no --history-file=no -e using InteractiveUtils, Sockets, SymbolServer, LanguageServer; server = LanguageServer.LanguageServerInstance( stdin, stdout,"/Users/roiholtzman/Projects/07_reset_systems/07_code/LocalResetExclusionProcessWatson/","", nothing, "/Users/roiholtzman/.julia/symbolstorev2-lsp-julia"); run(server);" is present on the path.
Command "julia --startup-file=no --history-file=no -e using InteractiveUtils, Sockets, SymbolServer, LanguageServer; server = LanguageServer.LanguageServerInstance( stdin, stdout,"/Users/roiholtzman/Projects/07_reset_systems/07_code/LocalResetExclusionProcessWatson/","", nothing, "/Users/roiholtzman/.julia/symbolstorev2-lsp-julia"); run(server);" is present on the path.
Command "julia --startup-file=no --history-file=no -e using InteractiveUtils, Sockets, SymbolServer, LanguageServer; server = LanguageServer.LanguageServerInstance( stdin, stdout,"/Users/roiholtzman/Projects/07_reset_systems/07_code/LocalResetExclusionProcessWatson/","", nothing, "/Users/roiholtzman/.julia/symbolstorev2-lsp-julia"); run(server);" is present on the path.
Found the following clients for /Users/roiholtzman/Projects/07_reset_systems/07_code/LocalResetExclusionProcessWatson/src/dynamics.jl: (server-id julia-ls, priority 0)
The following clients were selected based on priority: (server-id julia-ls, priority 0)
@juanscr
Copy link

juanscr commented Mar 19, 2021

See this issue.

TL;DR: Add to your config file (setq lsp-enable-folding t) to fix it.

@roiholtzman
Copy link
Author

See this issue.

TL;DR: Set (setq lsp-enable-folding t) to fix it.

thanks!
I added this to my configuration:

(setq lsp-julia-package-dir nil)
(setq lsp-julia-default-environment "~/.julia/environments/v1.5")
(setq lsp-enable-folding t)

Now I get the following error:

ERROR: MethodError: no method matching Union{Int64, String}(::String)
Stacktrace:
 [1] LanguageServer.InitializeParams(::Dict{String,Any}) at /Users/roiholtzman/.julia/packages/LanguageServer/y1ebo/src/protocol/initialize.jl:111
 [2] dispatch_msg(::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint,Base.PipeEndpoint}, ::JSONRPC.MsgDispatcher, ::Dict{String,Any}) at /Users/roiholtzman/.julia/packages/JSONRPC/xbAlZ/src/typed.jl:64
 [3] run(::LanguageServerInstance) at /Users/roiholtzman/.julia/packages/LanguageServer/y1ebo/src/languageserverinstance.jl:308
 [4] top-level scope at none:1

Process julia-ls stderr finished

@juanscr
Copy link

juanscr commented Mar 26, 2021

Is there a way to replicate this error? I've never seen that, so maybe some steps to replicate it on my machine would be useful.

@roiholtzman
Copy link
Author

roiholtzman commented Mar 26, 2021

Is there a way to replicate this error? I've never seen that, so maybe some steps to replicate it on my machine would be useful.

@juanscr I am not sure. It seems to me that I didn't do anything special, I am using doom emacs, I installed the Julia LanguageServer, and I can't get the lsp to work in emacs.

@xukai92
Copy link

xukai92 commented Mar 29, 2021

I have exact the same issue. All I do is enable (julia +lsp) and putting the three lines in my config.el

(setq lsp-julia-package-dir nil)
(setq lsp-julia-default-environment "~/.julia/environments/v1.6")
(setq lsp-enable-folding t)

@xukai92
Copy link

xukai92 commented Mar 29, 2021

I resolved this issue by upgrading Doom Emacs.
I believe this issue is related to this commit f82a3c6,
which on its own seems to be a "hack" to make things work in LS.jl?

@gdkrmr
Copy link
Owner

gdkrmr commented Mar 29, 2021

Yes, resolving this took quite a while to get it to work and still feels somewhat hacky.

@gdkrmr gdkrmr closed this as completed Mar 29, 2021
@roiholtzman
Copy link
Author

that't great! upgrading also solved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants