0

so I'm trying to get LSP working for Julia using the CoC Plugin. It works for python or HTML. So I'm using:

Coc-Plugin: https://github.com/neoclide/coc.nvim CoC-Extension (coc-julia): https://github.com/neoclide/coc.nvim/wiki/Language-servers#julia LSP-Server: https://github.com/julia-vscode/LanguageServer.jl (recommended by the Coc-extension)

I also did:

julia> using Pkg
julia> Pkg.add("LanguageServer")
julia> Pkg.add("SymbolServer")
julia> Pkg.add("StaticLint")

Doesn't really work. I don't get any definitions. If I write "a" I just get a bunch of possible functions starting with a. Also jump to definition doesn't seem to work. Either the server is just useless or I'm doing something wrong. Chances are way higher on the later.

I then uninstalled the coc extension and added the server config manually to my coc-settings.json - of course I first tried if the arguments in the config worked. They didn't, might be a bug in the docs in the git of Coc. Anyway, I got this now: which should work according to https://github.com/julia-vscode/LanguageServer.jl/wiki/Vim-and-Neovim

{
    "python.jediEnabled": false,
    "languageserver": {
        "julia": {
            "command": "/usr/bin/julia",
            "args" : ["--startup-file=no", "--history-file=no", "-e",
           "using LanguageServer; using Pkg; import StaticLint; import SymbolServer; en
            "filetypes": ["julia"]
        }
    }
}

but same result. Now I'm having kind of a hard time debugging it since I'm new to Neovim and Coc but ps aux | grep -i julia shows that

/usr/bin/julia --startup-file=no --history-file=no --depwarn=no --eval using LanguageServer; import StaticLint; import SymbolServer; server = LanguageServer.LanguageServerInstance(stdin, stdout, "/home/<user>/.julia/environments/v1.5"); server.runlinter = true; run(server);

is running. (The command also works just fine or at least doesn't throw an error.) So the server should run. And journalctl -n 40 also doesn't show anything.

CocOpenLog also shows 1 2020-09-15T17:16:14.568 INFO (pid:5526) [services] - registered service "languageserver.julia"

So I assume that Neovim/Coc has a connection to my server. I'm unsure it's actually using it though. Again, maybe the server just doesn't really do much?

Any input is appreciated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.