elixir-tools / elixir-tools.nvim Goto Github PK
View Code? Open in Web Editor NEWNeovim plugin for Elixir
License: MIT License
Neovim plugin for Elixir
License: MIT License
Hi there,
I was very confused as to why my some of my Vim deletion commands didn’t work, like dtX
(delete until the next X
character), until I noticed this, which I copied from this repo’s README:
-- standard lsp keybinds
vim.keymap.set("n", "df", "<cmd>lua vim.lsp.buf.formatting_seq_sync()<cr>", map_opts)
vim.keymap.set("n", "gd", "<cmd>lua vim.diagnostic.open_float()<cr>", map_opts)
vim.keymap.set("n", "dt", "<cmd>lua vim.lsp.buf.definition()<cr>", map_opts)
vim.keymap.set("n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", map_opts)
vim.keymap.set("n", "gD","<cmd>lua vim.lsp.buf.implementation()<cr>", map_opts)
vim.keymap.set("n", "1gD","<cmd>lua vim.lsp.buf.type_definition()<cr>", map_opts)
-- keybinds for fzf-lsp.nvim: https://github.com/gfanto/fzf-lsp.nvim
-- you could also use telescope.nvim: https://github.com/nvim-telescope/telescope.nvim
-- there are also core vim.lsp functions that put the same data in the loclist
vim.keymap.set("n", "gr", ":References<cr>", map_opts)
vim.keymap.set("n", "g0", ":DocumentSymbols<cr>", map_opts)
vim.keymap.set("n", "gW", ":WorkspaceSymbols<cr>", map_opts)
vim.keymap.set("n", "<leader>d", ":Diagnostics<cr>", map_opts)
Not sure what makes these “standard”, but it might be a bit more beginner-friendly having the example code use bindings that do not conflict with core Vim bindings, using <leader>
, or at least clearly state that this is what’s going on.
We should include a version of the mix command palette that I have in my dotfiles.
Should probably include a fzf extension and a telescope extension.
When following the minimal setup and setting require("elixir").setup()
, the plugin fails to load with the error message that opts is nil in init.lua.
https://github.com/mhanberg/elixir.nvim/blob/9edb86abf7a38cb5305163872e326c3d4c3866d7/lua/elixir/language_server/init.lua#L265
After I provided options in the setup method, the plugin could be loaded.
Like the title says, is this possible? I like that with elixir-vim in @doc
comments examples are rendered a different color.
There should be an ergonomic way to update ElixirLS. Something like :ElixirUpdateLanguageServer
.
I'm not really sure what sort of Elixir specific treesitter integrations we can include, but we'll use this issue to collect them and track them.
Please see this issue I posted in glepnir/lspsaga.nvim.
Copied here:
Describe the bug
Moving down in the window opened by
:Lspsaga outline
throws errors: Error 10:36:25 msg_show.lua_error Error executing vim.schedule lua callback: ...neovim/0.8.2/share/nvim/runtime/lua/vim/lsp/codelens.lua:166: Invalid buffer id: <BUFFER_ID> stack traceback: [C]: in function 'nvim_buf_attach' ...neovim/0.8.2/share/nvim/runtime/lua/vim/lsp/codelens.lua:166: in function 'save' ...neovim/0.8.2/share/nvim/runtime/lua/vim/lsp/codelens.lua:229: in function 'handler' ...w/Cellar/neovim/0.8.2/share/nvim/runtime/lua/vim/lsp.lua:1383: in function '' vim/_editor.lua: in function <vim/_editor.lua:0>Steps to reproduce
Using this
init.lua
:require('packer').startup(function(use) use { 'glepnir/lspsaga.nvim', event = 'VimEnter', requires = { 'nvim-tree/nvim-web-devicons' }, config = function() require('lspsaga').setup { lightbulb = { enable_in_insert = false, virtual_text = false, }, symbol_in_winbar = { enable = false, }, ui = { border = 'none', }, } end, } use { 'mhanberg/elixir.nvim', ft = { 'elixir' }, config = function() local ex = require('elixir') ex.setup { cmd = 'elixir-ls', settings = ex.settings { enableTestLenses = true, suggestSpecs = true, }, } end } end)(I suspect that it does not have to be an Elixir LS, but any LS.)
Open up a new Neovim session and
:PackerCompile
.Reopen Neovim in a project so that the buffer has LSP attached. It seems that the buffer needs to have functions.
Run
:Lspsaga outline
.Press down j for a little while.
Expected behavior
No error should occur.
Also, the floating window should be above the outline window, but that is another bug.
Neovim version (nvim -v)
NVIM v0.8.2
lspsaga commit
Terminal name/version
alacritty 0.11.0 (8dbaa0b)
Enable or document how to use the basic code action support that was added
Link: elixir-lsp/elixir-ls#718
Hi there
Thanks for making this plugin.
I was testing it out, and I’m getting this error whenever i load an .ex(s) file:
I presume this is due to the change in 1128046, for which I guess you have to use the NeoVim nightly build for vim.fs
to be available?
This is my nvim --version
:
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.7.2/share/nvim"
Run :checkhealth for more info
Not a big problem, one can just go back to an earlier version for now, but you might want to update the README, since it currently states that you only need NeoVim 0.7.
With the command to retrieve tests in a file, we should surface this through vim.ui.select
to allow a user to run a specific test.
Similar to the test code lens, but doesn't require you to have your cursor on the line with the virtual text.
Dependent on #45.
I got this error after I updated the plugin to the latest version.
Spawning language server with cmd: `...al/share/nvim/lazy/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server` failed. The language server is either not installed, missing from│
PATH, or not executable
I thought the elixir-tools would install the binary after launching the neovim.
It seems different because of the error above. Do you know if there is anything I
missed here? I've tried deleting the cache folder, but nothing is improved.
Any help would be appreciated.
Credo doesn't quit when stdin closes, causing orphaned processes
Originally posted by kenichi May 11, 2023
Hi and thanks for this plugin! Before opening an issue, I wanted to check:
On macos, using either homebrew or asdf-built elixir/erlang, nvim 0.9, latest elixir-tools.nvim with the config below, I see a lingering credo-language-server process after quitting nvim:
501 28314 1 0 11:05AM ?? 0:03.02 /opt/homebrew/Cellar/erlang/25.3.2/lib/erlang/erts-13.2.2/bin/beam.smp -- -root /opt/homebrew/Cellar/erlang/25.3.2/lib/erlang -bindir /opt/homebrew/Cellar/erlang/25.3.2/lib/erlang/erts-13.2.2/bin -progname erl -- -home [$HOME] -- -kernel shell_history enabled -- -pa /opt/homebrew/Cellar/elixir/1.14.4/bin/../lib/eex/ebin /opt/homebrew/Cellar/elixir/1.14.4/bin/../lib/elixir/ebin /opt/homebrew/Cellar/elixir/1.14.4/bin/../lib/ex_unit/ebin /opt/homebrew/Cellar/elixir/1.14.4/bin/../lib/iex/ebin /opt/homebrew/Cellar/elixir/1.14.4/bin/../lib/logger/ebin /opt/homebrew/Cellar/elixir/1.14.4/bin/../lib/mix/ebin -noshell -s elixir start_cli -- -extra [$HOME]/.local/share/nvim/lazy/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server --stdio
here is ~/.config/nvim/lua/plugins/elixir-tools.lua
:
return {
{
"elixir-tools/elixir-tools.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local elixir = require("elixir")
local elixirls = require("elixir.elixirls")
elixir.setup {
credo = {},
elixirls = {
-- tag = "v0.14.6",
enabled = true,
settings = elixirls.settings {
dialyzerEnabled = true,
enableTestLenses = false,
},
on_attach = function(client, bufnr)
-- whatever keybinds you want, see below for more suggestions
-- vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
-- vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
-- vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
local map_opts = { buffer = true, noremap = true}
vim.keymap.set("n", "<leader>cf", "<cmd>lua vim.lsp.buf.format({async = true})<cr>", map_opts)
vim.keymap.set("n", "<leader>cd", "<cmd>lua vim.diagnostic.open_float()<cr>", map_opts)
vim.keymap.set("n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", map_opts)
end,
}
}
end,
dependencies = {
"nvim-lua/plenary.nvim",
},
}
}
Note that I share my nvim config on a linux host and do not have the problem there. Has this been noticed before, or do you see something wrong in my config?
I get the following error on nvim startup after an upgrade:
Error detected while processing ~/dotfiles/config/nvim/init.vim:
line 192:
E5108: Error executing lua ...share/nvim/plugged/elixir-tools.nvim/lua/elixir/init.lua:16: attempt to index local 'opts' (a nil value)
stack traceback:
...share/nvim/plugged/elixir-tools.nvim/lua/elixir/init.lua:16: in function 'setup'
[string ":lua"]:50: in main chunk
I'm using https://github.com/junegunn/vim-plug as the plugin manager and the only elixir related config I have is
Plug 'elixir-tools/elixir-tools.nvim'
require("elixir").setup()
I am using the master version. ElixirRestart, ElixirFromPipe... are not found. I think that it is because I have a problem during the "Install ElixirLS" step. How can I rerun the setup again? I tried to reinstall and delete .elixir_ls
but it not make the "Install ElixirLS" question apear again.
I get the following error when exiting Vim after editing an Elixir file.
Error executing vim.schedule lua callback: ...er/start/elixir.nvim/lua/elixir/language_server/init.lua:300: Failed to insert line
stack traceback:
[C]: in function 'nvim_buf_set_lines'
...er/start/elixir.nvim/lua/elixir/language_server/init.lua:300: in function 'handler'
...r/neovim/HEAD-050b0e3/share/nvim/runtime/lua/vim/lsp.lua:1054: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>%
Here's my elixir.nvim
config:
local elixir = require("elixir")
local on_attach = require("mike.lsp_handlers").on_attach
local capabilities = require("mike.lsp_handlers").capabilities
elixir.setup({
cmd = "/Users/mikebowman/.local/share/nvim/mason/bin/elixir-ls",
settings = elixir.settings({
dialyzerEnabled = true,
fetchDeps = false,
enableTestLenses = false,
suggestSpecs = false
}),
on_attach = function(client, bufnr)
local map_opts = { buffer = true, noremap = true }
-- remove the pipe operator
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", map_opts)
-- add the pipe operator
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", map_opts)
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", map_opts)
on_attach(client, bufnr)
end,
capabilities = capabilities
})
and here's my generic LSP handlers
local M = {
on_attach = function(client, bufnr)
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<leader>gwa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>gwr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>gwl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<leader>gD', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<leader>grn', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<leader>gca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<leader>lf', function() vim.lsp.buf.format() end, bufopts)
end,
capabilities = require("cmp_nvim_lsp").default_capabilities()
}
return M
Erlang/OTP 24 [erts-12.3.2.10] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]
Elixir 1.14.1 (compiled with Erlang/OTP 24)
ElixirLS release v0.14.3
Ubuntu 20.04.6 LTS, x86
Language server: Installed automatically. See :LspInfo
below.
When an elixir file is opened neovim reports Client 2 quit with exit code 1 and signal 0
.
:LspInfo
Detected filetype: elixir
1 client(s) attached to this buffer:
Client: ElixirLS (id: 1, bufnr: [1])
filetypes:
autostart: false
root directory: /home/boschrexroth/wspc/elixir/rest_api
cmd: /home/boschrexroth/.cache/nvim/elixir-tools.nvim/installs/elixir-lsp/elixir-ls/tags_v0.13.0/1.14.1-24/language_server.sh
Configured servers list: gopls, clangd
:LspLog
[START][2023-04-19 18:55:10] LSP logging initiated
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "certifi" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:2:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "cowboy" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:3:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "cowboy_telemetry" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:4:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "cowlib" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:5:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "hackney" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:6:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "httpoison" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:7:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "idna" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:8:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "jason" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:9:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "metrics" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:10:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "mime" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:11:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "mimerl" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:12:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "parse_trans" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:13:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "plug" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:14:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "plug_cowboy" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:15:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "plug_crypto" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:16:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "plug_proxy" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:17:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "plug_static_index_html" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:18:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "ranch" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:19:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "reverse_proxy_plug" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:20:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "ssl_verify_fun" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:21:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "telemetry" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:22:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" 'warning: found quoted keyword "unicode_util_compat" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes\n mix.lock:23:4\n\n'
[ERROR][2023-04-19 18:55:10] .../vim/lsp/rpc.lua:733 "rpc" "/home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" '** (MatchError) no match of right hand side value: {%{certifi: {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"}, cowboy: {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"}, cowboy_telemetry: {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, cowlib: {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"}, hackney: {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~> 2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, httpoison: {:hex, :httpoison, "2.1.0", "655fd9a7b0b95ee3e9a3b535cf7ac8e08ef5229bab187fa86ac4208b122d934b", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "fc455cb4306b43827def4f57299b2d5ac8ac331cb23f517e734a4b78210a160c"}, idna: {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, jason: {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"}, metrics: {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, mime: {:hex, :mime, "2.0.3", "3676436d3d1f7b81b5a2d2bd8405f412c677558c81b1c92be58c00562bb59095", [:mix], [], "hexpm", "27a30bf0db44d25eecba73755acf4068cbfe26a4372f9eb3e4ea3a45956bff6b"}, mimerl: {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, parse_trans: {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, plug: {:hex, :plug, "1.14.2", "cff7d4ec45b4ae176a227acd94a7ab536d9b37b942c8e8fa6dfc0fff98ff4d80", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "842fc50187e13cf4ac3b253d47d9474ed6c296a8732752835ce4a86acdf68d13"}, plug_cowboy: {:hex, :plug_cowboy, "2.6.1", "9a3bbfceeb65eff5f39dab529e5cd79137ac36e913c02067dba3963a26efe9b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "de36e1a21f451a18b790f37765db198075c25875c64834bcc82d90b309eb6613"}, plug_crypto: {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"}, plug_proxy: {:hex, :plug_proxy, "0.4.0", "1701be9dc2aa2fea4fc5238974839d3ac227d1e035ef041570e6ad8650b1cd83", [:mix], [{:cowboy, "~> 1.0 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: false]}, {:hackney, "~> 1.10", [hex: :hackney, repo: "hexpm", optional: false]}, {:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "d74796aa504c0717fe45e7b49453d6df17e920a5ff52cb7a5aab5af65d5f4ace"}, plug_static_index_html: {:hex, :plug_static_index_html, "1.0.0", "840123d4d3975585133485ea86af73cb2600afd7f2a976f9f5fd8b3808e636a0", [:mix], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "79fd4fcf34d110605c26560cbae8f23c603ec4158c08298bd4360fdea90bb5cf"}, ranch: {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, reverse_proxy_plug: {:hex, :reverse_proxy_plug, "2.2.0", "3c54f9c8e7c0a9559bc2f215990c03e68074d43f0facfd396930525e2b6a8a19", [:mix], [{:cowboy, "~> 2.4", [hex: :cowboy, repo: "hexpm", optional: false]}, {:httpoison, "~> 1.2 or ~> 2.0", [hex: :httpoison, repo: "hexpm", optional: true]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: false]}, {:tesla, "~> 1.4", [hex: :tesla, repo: "hexpm", optional: true]}], "hexpm", "391a6307188fef99deed033e2d636e7d42d565576ca4cb1c0b2322e5939b7997"}, ssl_verify_fun: {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"}, telemetry: {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, unicode_util_compat: {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}}, []}\n /home/boschrexroth/.local/share/nvim/site/pack/paqs/start/elixir-tools.nvim/bin/credo-language-server:5: (file)\n (elixir 1.14.1) lib/code.ex:1245: Code.require_file/2\n'
VSCode has an "Output Panel" that ElixirLS displays certain logs and errors that happen with the language server.
I'd like to have a buffer you can pop open in a float or in a split that shows the same information.
We have some tests already, but we need to have them running in GitHub Actions.
this will require getting the "minimal config" init.vim file setup I believe.
During the first launch, elixir-ls failed to clone, after git cloning the files.
The error was a missing .git file.
On second launch, nvim was burping out a log, after 1 was pressed, with the message mentioned in the issue name.
What can explain this behavior?
I have no issue manually cloning other repo. I got this issue only with elixir-ls.
projection for creating schema files
Currently when ElixirLS is downloaded and compiled, it all happens inside of the .elixir_ls directory of your project.
We should move the source code download and the release artifacts to the ~/.cache directory so that all project don't have to redownload and recompile if they don't need to.
will it be hard to add a feature that the plugin uses a container of ElixirLS?
Originally posted by @qwexvf in #13 (comment)
Error detected while processing /home/joao/.config/nvim/init.lua:
E5113: Error while calling lua chunk: ...m/site/pack/packer/start/elixir.nvim/lua/elixir/init.lua:226: attempt to index local 'opts' (a nil value)
stack traceback:
...m/site/pack/packer/start/elixir.nvim/lua/elixir/init.lua:226: in function 'setup'
/home/joao/.config/nvim/init.lua:167: in main chunk
Press ENTER or type command to continue
I see the same error message when opening an umbrella project.
I have credo
in mix.exs
under project/services/mix.exs
. As I'm an nvim newbie, please advise if there's any additional information needed or if I should open another issue.
nvim 0.9.0
elixir-tools `43c2288`
LazyVim 2.11.0
:LspLog
[START][2023-04-24 10:09:22] LSP logging initiated
[ERROR][2023-04-24 10:09:22] .../vim/lsp/rpc.lua:734 "rpc" "/home/yuri/.local/share/nvim/lazy/elixir-tools.nvim/lua/elixir/../../bin/credo-language-server" "stderr" "** (Code.LoadError) could not load /home/yuri/project/mix.lock. Reason: enoent\n (elixir 1.14.4) lib/code.ex:1826: Code.find_file!/2\n (elixir 1.14.4) lib/code.ex:1199: Code.eval_file/2\n /home/yuri/.local/share/nvim/lazy/elixir-tools.nvim/bin/credo-language-server:5: (file)\n"
[WARN][2023-04-24 10:09:25] ...lsp/handlers.lua:537 'warning: Phoenix now requires you to explicitly list which engine to use\nfor Phoenix JSON encoding. We recommend everyone to upgrade to\nJason by setting in your config/config.exs:\n\n config :phoenix, :json_library, Jason\n\nAnd then adding {:jason, "~> 1.0"} as a dependency.\n\nIf instead you would rather continue using Poison, then add to\nyour config/config.exs:\n\n config :phoenix, :json_library, Poison\n\n (phoenix 1.6.16) lib/phoenix.ex:56: Phoenix.start/2\n (kernel 8.5.4) application_master.erl:293: :application_master.start_it_old/4\n'
Originally posted by @yuriploc in #67 (comment)
Thanks a lot for elixir.nvim
.
Thanks a lot for your blogposts about how to setup neovim for elixir development. They are massively helpful.
It would be great if Credo can be integrated with this plugin.
Although the LS is working and this test file test/islands_engine_test.exs
has been saved, no errors are generated for the missing end
and incorrect function call.
Using this minimum init.lua
:
require('packer').startup(function (use)
use {
'mhanberg/elixir.nvim',
config = function()
local ex = require('elixir')
ex.setup {
cmd = 'elixir-ls',
settings = ex.settings {
enableTestLenses = true,
suggestSpecs = true,
},
}
end
}
end)
I can confirm that linting does work for files in the lib
, e.g. lib/islands_engine/rules.ex
.
Not sure if this is a problem with LSP or elixirls. I recall having it work properly with coc-elixir, though.
When executing :Mix deps.get
I get the following error:
Error executing Lua callback: vim/shared.lua:0: s: expected string, got nil
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
vim/shared.lua: in function 'startswith'
.../site/pack/packer/start/elixir.nvim/lua/elixir/utils.lua:28: in function 'root_dir'
...pack/packer/start/elixir.nvim/lua/elixir/mix/wrapper.lua:36: in function 'run'
...te/pack/packer/start/elixir.nvim/lua/elixir/mix/init.lua:23: in function 'run'
...te/pack/packer/start/elixir.nvim/lua/elixir/mix/init.lua:42: in function 'load_command'
...te/pack/packer/start/elixir.nvim/lua/elixir/mix/init.lua:14: in function <...te/pack/packer/start/elixir.nvim/lua/elixir/mix/init.lua:13>
My configuration is as minimal as it can be:
require("elixir").setup()
Maybe I misunderstood how much configuration this plugin needs? I am happy to spend some time on this issue to debug it with the right starting point.
I don't think we necessarily need to depend on the lspconfig library and can re-write some things to not have to use it.
nvim-metals does not depend on lspconfig.
We should expose a function to run the expandMacro workspace command.
Based on how I think this works in the VSCode plugin, it should probably open a floating window (similar to the hover documentation) that displays the syntax highlighted source code that the language server returns.
I'm using https://github.com/nvim-telescope/telescope-ui-select.nvim to change vim.ui.select
to a Telescope picker.
I can see the window, but I can't interact with it, anything I do is reflected in the window in the background
When I disable the extension, I get the regular selector, and it works properly. I guess because the default is blocking while Telescope is not.
Implement the mix clean custom command that was introduced in 0.12
Link: elixir-lsp/elixir-ls#730
There needs to be vim docs in edition to the readme.
ElixirLS implements the debugger protocol that is compatible with nvim-dap and the plugin should expose an easy to use integration with lots of documentation.
Adding elixir.nvim and then installing elixirls once it asked me to made my config load take 2s+.
i.e doing nvim foo.ex --startuptime output
does this:
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.007 000.007: --- NVIM STARTING ---
...(truncated)
1989.936 1916.747: opening buffers. <---- line in question
2009.648 019.712: BufEnter autocommands
2009.650 000.003: editing files in windows
2009.777 000.126: VimEnter autocommands
2009.801 000.024: UIEnter autocommands
2009.803 000.002: before starting main loop
2119.209 109.407: first screen update
2119.212 000.002: --- NVIM STARTED ---
Now removing elixir.nvim from my config:
...(truncated)
190.560 122.877: opening buffers
190.614 000.054: BufEnter autocommands
190.616 000.002: editing files in windows
190.702 000.086: VimEnter autocommands
190.739 000.037: UIEnter autocommands
190.959 000.100 000.100: sourcing /Users/njichev/.asdf/installs/neovim/0.8.2/share/nvim/runtime/autoload/provider/clipboard.vim
190.964 000.126: before starting main loop
283.900 092.936: first screen update
283.904 000.003: --- NVIM STARTED ---
Note that Lazy's profiling says that elixir.nvim loads quite fast:
● elixir 7.26ms
➜ elixir.nvim 5.96ms
★ plenary.nvim 0.35ms
‒ plenary.nvim/plugin/plenary.vim 0.06ms
I tried switching between neovim versions 0.8.2
, 0.8.3
and stable
in asdf and I get the same results on each.
I used the default config for the lazy.nvim plugin manager in the readme: https://github.com/mhanberg/elixir.nvim#lazynvim
So what am I doing wrong, I recently started moving my vimscript config to lua so I might be perfectly messing something up 😅
Edit: I also tried opening a file in a project, i.e nvim lib/page.ex
for example and get the same behaviour if that's any information.
Edit2: I am using the following elixir/erlang versions: 1.14.3-otp-25
/25.3
on a macbook with M1 Pro
One thing I'm noticing as far as Projectionist features are concerned is that running commands to create files such as :Econtroller post
creates the file in /lib/controllers/post_controller.ex
instead of the intended /lib/blog_web/controllers/post_controller.ex
.
The controller itself also lacks the project name and results in:
defmodule .PostController do
use , :controller
end
When switching between files with :A
the plugin has the proper context to know what folder sits in the glob for /lib/**/controllers/post_controller.ex
, but the creation commands don't have any context.
I'm unsure if we're able to provide that context to Projectionist.
ElixirLS needs to use the .bat script if we're running on windows, but it's currently hard coded to the shell script.
It currently is hard coded to install v0.9.0, but it should just install the latest stable release.
Would it be possible to use mason for LSP management but have also the nice integration with elixir-tools?
ElixirLS is available through mason, but is it possible to add Credo LSP also to masen, so it could be managed with this tool?
Unclear if this actually means something relevant, but every time I start Neovim on an Elixir project, I get the following informational message:
LSP[elixirls][Info] Did not receive workspace/didChangeConfiguration notification
after 5 seconds. Using default settings.
Maybe I should file this in the https://github.com/elixir-lsp/elixir-ls project instead?
Currently it just installs v0.9.0 (hard coded), but some people may want to downgrade or run HEAD.
Add the custom command to retrieve the list of tests in a file.
Link: elixir-lsp/elixir-ls#753
Probably best to fill the quick fix or loclist with them.
There should be ex commands defined for all the of the workspace commands.
Example:
ElixirExpandMacro
ElixirManipulatePipes
ElixirRestart
Example configuration in the README has this line:
vim.keymap.set("n", "<space>df", "<cmd>lua vim.lsp.buf.formatting_seq_sync()<cr>", map_opts)
But it returns an error:
E5108: Error executing lua [string ":lua"]:1: attempt to call field 'formatting_seq_sync' (a nil value) stack traceback: [string ":lua"]:1: in main chunk
This function works for me though:
vim.lsp.buf.format()
I don't really know anything about Neovim/LSPs/etc so hopefully I got it right here. Anyways, awesome plugin!
NVIM v0.9.0-dev-701+g34b973b1d Build type: RelWithDebInfo LuaJIT 2.1.0-beta3
Would be nice to have a project for creating a new mix task.
From reading your code is not clear what suggestSpecs
does, or if you have any control over the highlight group name of the spec, I'd like to know for theming purposes.
elixir-tools.nvim should have a health check to verify common details that might escape the common user
Hey, nice plugin! 💙
Been wondering if you could make the "lsp management" stuff (installing, starting the server, running tests, etc) under a configuration flag? I'm interested in other features from this plugin (e.g. ElixirFromPipe) but I don't want to lose my current lsp setup haha
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.