Closed bigardone closed 1 year ago
So those warnings shouldn't be a problem. Unrelated consequence.
Does the project you are trying it with use credo itself?
Also, make sure you have pulled down the latest changes. I made a change to the bin script last night.
One thing that elixir-tools extensions do is only start the LSP if the mix.exs file has credo in it (they just do a simple search for {:credo,
).
👋🏼 All my projects include credo as a dependency, and I'm running credo's LS latest version. I'll try to figure out the issue over the weekend. 🙌🏼
Please try starting credo in a terminal with ~/projects/elixir/credo-ls/bin/credo-language-server --port 9000
(from your project root directory) and then change your config to
{
...
"languageserver": {
"credoLS": {
"host": "127.0.0.1",
"port": 9000,
"filetypes": [
"elixir",
"eelixir",
"heex"
],
"rootPatterns": [
"mix.exs"
]
},
"elixirLS": {
"command": "~/projects/elixir/elixir-ls/release/language_server.sh",
"filetypes": [
"elixir",
"eelixir",
"heex"
],
"rootPatterns": [
"mix.exs"
]
},
....
}
and please let me know what is the output in the terminal running after opening an elixir file
That seems to work 🎉
Do we have to start it always manually?
No, I just wanted to make sure that it wasn't spitting out any weird errors and starting it manually with a port makes it easier to see that.
According to that, it should work with your originally config.
Do you mind reverting to your original config and trying again?
It's finally working 🎉 This did the trick:
"credoLS": {
"command": "~/projects/elixir/credo-ls/bin/credo-language-server",
"args": [
"--port",
"9000",
"--stdio"
],
"filetypes": [
"elixir",
"eelixir",
"heex"
],
"rootPatterns": [
"mix.exs"
]
},
Thanks for the help 🙌🏼
you don't need to pass the --port 9000 arg if you are going to use --stdio.
I think the original problem was that I was thinking that if you passed no args, it defaulted to --stdio
behavior, but I actually changed that and made one of them required.
There should have been more errors in your lsp log, but i'm not sure how coc works so it must work differently.
glad its working tho!
you don't need to pass the --port 9000 arg if you are going to use --stdio.
Working like a charm! Thanks again for the help 🙌🏼
👋🏼 @mhanberg After upgrading to 0.1.1
and forth, I'm not able to run the server using CoC again. Do I need to change anything in the custom LS configuration? Here's the error:
** (RuntimeError) no shell process input given for yes?/2
(mix 1.14.5) lib/mix/shell/process.ex:148: Mix.Shell.Process.yes?/2
(mix 1.14.5) lib/mix/tasks/deps.compile.ex:256: Mix.Tasks.Deps.Compile.handle_rebar_not_found/1
(mix 1.14.5) lib/mix/tasks/deps.compile.ex:218: Mix.Tasks.Deps.Compile.do_rebar3/2
(mix 1.14.5) lib/mix/tasks/deps.compile.ex:96: anonymous fn/4 in Mix.Tasks.Deps.Compile.compile/2
(elixir 1.14.5) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
(mix 1.14.5) lib/mix/tasks/deps.compile.ex:80: Mix.Tasks.Deps.Compile.compile/2
(mix 1.14.5) lib/mix/tasks/deps.loadpaths.ex:84: Mix.Tasks.Deps.Loadpaths.deps_check/2
(mix 1.14.5) lib/mix/tasks/deps.loadpaths.ex:43: Mix.Tasks.Deps.Loadpaths.run/1
[Error - 07:48:22.845] ~/projects/elixir/credo-ls/bin/credo-language-server exited with code: 1
[Error - 07:48:22.845] Connection to server got closed. Server will not be restarted.
[Error - 07:48:22.845] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
And this is the config working until 0.1.1
:
"credoLS": {
"command": "~/projects/elixir/credo-ls/bin/credo-language-server",
"args": [
"--stdio"
],
"filetypes": [
"elixir",
"eelixir",
"heex"
],
"rootPatterns": [
"mix.exs"
],
},
Can you try with the latest version and let me know.
Sure, I'm currently running 0.1.3
from the main branch, and it is throwing that error. 🙌🏼
Hello! First of all thank you for developing this great LS 🙌🏼
I'm a nvim user, but I use CoC for language server support rather than nvim's built in lsp. To use custom language servers with CoC, you can do it manually by adding something like this to its config file:
However,
credo-language-server
does not seem to work. When I check its output I get the following:However CoC does not show any credo warnings like the language server does while using it with
elixir-tools.nvim
. Is it possible to use it this way?Thanks in advance