Using lsp-julia

For reference/comparison, here is what this outputs for me:

$ julia --startup-file=no --history-file=no "-e using LanguageServer, Sockets, SymbolServer; server = LanguageServer.LanguageServerInstance( stdin, stdout, false, \"/home/francois/.julia/environments/v1.0\", \"\",Dict()); server.runlinter = true; run(server);"
[ Info: Started symbol server
[ Info: StaticLint store set

and then it waits for input (and errors out if you input something incorrect, terminated by a blank line).


No, the modeline should display

LSP[julia-ls:23615]

after a little while.


Most of the time I don’t, either. The only times when I managed to have an error in the modeline were when I tried using advanced LSP features which the julia server does not implement. In these cases, the server did start, then crashed. Some info was available in the *julia-ls::stderr* buffer, and I was prompted (in the minibuffer) to restart the LSP server.

You should however find in *julia-ls::sterr* the same output as in the command line above:

[ Info: Started symbol server
[ Info: StaticLint store set

Here are two things that the LSP documentation mentions to help troubleshoot server issues:

  • M-xlsp-describe-session opens an *lsp-session* buffer showing some information about active servers and registered project.
  • M-:(setq lsp-print-io t): this makes lsp-mode trace all client-server exchanges in the *lsp-log* buffer

For me, a typical *lsp-log* buffer starts like this:

>>> julia-ls:5202 status:starting(async)
Content-Length: 1867

{
  "jsonrpc": "2.0",
  "method": "initialize",
  "params": {
      [...]
  },
  "id": 1
}

<<<< julia-ls:5202 status:starting
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
     [...]
  }
}

>>> julia-ls:5202(async)
Content-Length: 69

{
  "jsonrpc": "2.0",
  "method": "initialized",
  "params": {
  }
}

>>> julia-ls:5202(async)
Content-Length: 345

{
  "jsonrpc": "2.0",
  "method": "textDocument/didOpen",
  "params": {
       [...]
  }
}

<<<< julia-ls:5202
{
  "method": "client/registerCapability",
  "id": "278352324",
  "params": {
      [...]
  },
  "jsonrpc": "2.0"
}

>>> julia-ls:5202(async)
Content-Length: 62

{
  "jsonrpc": "2.0",
  "id": "278352324",
  "result": null
}
1 Like