Closed philippseith closed 1 year ago
is this connected to https://github.com/elixir-lsp/elixir-ls/issues/871?
is this connected to elixir-lsp/elixir-ls#871?
no
it looks like you don't have credo installed and in your lockfile.
but do you have it in your mix.exs? the plugin checks for the presence of it in your mix.exs file and doesn't launch if it's not there, so then it will assume it's in your mix.lock
I don't have credo in mix.exs or mix.lock. It happens with
mix new minimal
cd minimal
nvim mix.exs
When credo is added and run once, the message is gone.
Even if credo is a great tool, it should be optional and the plugin should work without warnings.
It is not supposed to even start the credo language server if credo isn't found, which is why I asked.
I'll see if I can replicate.
I was able to reproduce, this must be a regression. Thanks for the report.
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'
This is a different problem, currently the executable assumes you opened neovim in the same directory as your mix.lock, so that it can find your project's version of credo.
This seems to be broken for umbrella projects, i'll file a new issue.
Environment
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.Current behavior
When an elixir file is opened neovim reports
Client 2 quit with exit code 1 and signal 0
.Logs
:LspInfo
:LspLog