Version: NVIM v0.7.0-dev+975-g4a96e7809
Platform: Darwin (Big Sur)
ElixirLS version: v0.9.0 (elixir-ls-1.12)
I am having issues with elixirls
and am not sure if it is with the LS or the nvim lsp. I have asked around in the elixir community and no one else seems to have this issue. I don’t think it is the nvim lsp as this works with tsserver
without any hiccups. But thought I would ask here as I have hit a wall and don’t know where else to go.
The Issue:
Every command I to trigger via LSP, I do not get any feedback in nvim. I enabled the debug logs and compared against js working command, and noticed I do not get any rpc.receive
when using elixirls
.
The weird part is, that it will work 1 in 100 times… I will be able to go to def or hover dock using elixirls
but most the time i do not get any response. I put a small snippet of my config and output.
LSP Config:
local nvim_lsp = require("lspconfig")
local on_attach = function()
local opts = {buffer = 0}
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "gt", vim.lsp.buf.type_definition, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
vim.keymap.set("n", "<Leader>d", "<cmd>Telescope diagnostics<CR>", opts)
vim.keymap.set("n", "<Leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<Leader>r", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "<Leader>f", vim.lsp.buf.formatting, opts)
end
local function make_config()
return {on_attach = on_attach}
end
local servers = {"elixirls", "tsserver"}
for _, lsp in ipairs(servers) do
local config = make_config()
if lsp == "elixirls" then
config.settings = {
elixirLS = {dialyzerEnabled = false}
}
config.cmd = {
vim.loop.os_homedir() .. "/.local/share/elixir-ls/language_server.sh"
}
end
nvim_lsp[lsp].setup(config)
end
Debug output when trying to Hover Doc:
➜ ~ tail .cache/nvim/lsp.log
[DEBUG][2022-01-30 21:07:11] .../lua/vim/lsp.lua:1023 "LSP[elixirls]" "client.request" 1 "textDocument/hover" { position = { character = 13, line = 19 }, textDocument = { uri = "file:///Users/Tom.Konidas/dev/backoffice/lib/backoffice/affinity.ex" }} <function 1> 1
[DEBUG][2022-01-30 21:07:11] .../vim/lsp/rpc.lua:347 "rpc.send" { id = 4, jsonrpc = "2.0", method = "textDocument/hover", params = { position = { character = 13, line = 19 }, textDocument = { uri = "file:///Users/Tom.Konidas/dev/backoffice/lib/backoffice/affinity.ex" } }}
[DEBUG][2022-01-30 21:09:03] .../lua/vim/lsp.lua:1023 "LSP[elixirls]" "client.request" 1 "textDocument/hover" { position = { character = 13, line = 42 }, textDocument = { uri = "file:///Users/Tom.Konidas/dev/backoffice/lib/backoffice/affinity.ex" }} <function 1> 1
[DEBUG][2022-01-30 21:09:03] .../vim/lsp/rpc.lua:347 "rpc.send" { id = 5, jsonrpc = "2.0", method = "textDocument/hover", params = { position = { character = 13, line = 42 }, textDocument = { uri = "file:///Users/Tom.Konidas/dev/backoffice/lib/backoffice/affinity.ex" } }}
[DEBUG][2022-01-30 21:09:05] .../lua/vim/lsp.lua:1023 "LSP[elixirls]" "client.request" 1 "textDocument/hover" { position = { character = 24, line = 47 }, textDocument = { uri = "file:///Users/Tom.Konidas/dev/backoffice/lib/backoffice/affinity.ex" }} <function 1> 1
[DEBUG][2022-01-30 21:09:05] .../vim/lsp/rpc.lua:347 "rpc.send" { id = 6, jsonrpc = "2.0", method = "textDocument/hover", params = { position = { character = 24, line = 47 }, textDocument = { uri = "file:///Users/Tom.Konidas/dev/backoffice/lib/backoffice/affinity.ex" } }}
[DEBUG][2022-01-30 21:09:06] .../lua/vim/lsp.lua:1023 "LSP[elixirls]" "client.request" 1 "textDocument/hover" { position = { character = 24, line = 47 }, textDocument = { uri = "file:///Users/Tom.Konidas/dev/backoffice/lib/backoffice/affinity.ex" }} <function 1> 1
[DEBUG][2022-01-30 21:09:06] .../vim/lsp/rpc.lua:347 "rpc.send" { id = 7, jsonrpc = "2.0", method = "textDocument/hover", params = { position = { character = 24, line = 47 }, textDocument = { uri = "file:///Users/Tom.Konidas/dev/backoffice/lib/backoffice/affinity.ex" } }}
[DEBUG][2022-01-30 21:09:06] .../lua/vim/lsp.lua:1023 "LSP[elixirls]" "client.request" 1 "textDocument/hover" { position = { character = 24, line = 47 }, textDocument = { uri = "file:///Users/Tom.Konidas/dev/backoffice/lib/backoffice/affinity.ex" }} <function 1> 1
[DEBUG][2022-01-30 21:09:06] .../vim/lsp/rpc.lua:347 "rpc.send" { id = 8, jsonrpc = "2.0", method = "textDocument/hover", params = { position = { character = 24, line = 47 }, textDocument = { uri = "file:///Users/Tom.Konidas/dev/backoffice/lib/backoffice/affinity.ex" } }}