#Installing elixir LSP to use with coc vim

40 messages · Page 1 of 1 (latest)

peak cipher
#

I'm trying to configure Elixir LSP on my MacBook and tried to follow this video https://www.youtube.com/watch?v=FXpsUh0Hs9Y. But in the end the language server fails to load. How can I set up the language server?

🔹Join the exclusive Elixir group: https://elxpro.com/subscribe-elxcrew

Hello developers!

Have ever needed to update/downgrade your elixir version, or basically any other language in your machine just to work with a new project, but did not want to unistall your previous version? Well, that's what ASDF is for, check the video and let the magic ...

▶ Play video
#

I follow through everything accordingly

sweet vortex
#

Are you doing it with the coc-elixir extension?

#

I skimmed through the video, it seems he's also using Coc, so I've had random issues with that, just trying to remember how I sorted them

#

For example in :CocConfig (your coc-settings.json file) I do have:

  "elixir.pathToElixirLS": "~/.elixir-ls/release/language_server.sh"

Because at one point it stopped finding the server

peak cipher
sweet vortex
#

That's just where I have it installed

#

You should have a similar path or you'll need to find where it is

#

If you manually set the path it should rule out Coc not being able to find it

peak cipher
#

it's giving me this one

peak cipher
#

For any one having this error you just need to add this to your coc-settings.json

{
    "codeLens.enable": true,
    "emmet.includeLanguages": {"eelixir": "html", "smarty": "html", "javascript": "html"},
    "elixir.pathToElixirLS": "~/.elixir-ls/release/language_server.sh",
    "languageserver": {}
}
sweet vortex
sweet vortex
#

Curious to know too because for sure others will run into this

peak cipher
#

I was just going by trial and error

#

this popped up somewhere and it worked

sweet vortex
#

Ah, I see

#

I've had similar-ish errors, just didn't write down at the time what it was, it was also the the .js files

#

It's made me think of switching to using nvim's in-built LSP but Coc does provide a lot of things since it has been around for a while

peak cipher
#

Yeah, this LS when its working is really good but some times is a pain in the bum

peak cipher
sweet vortex
#

If/when I do, I'll let you know

peak cipher
#

btw @sweet vortex is LS is supposed to give inline diagnosis (build errors and warnings) right?

peak cipher
sweet vortex
#

Dialyzer messages are an issue since they're so long they get cut off, however you can use :CocDiagnostics and I'm sure there's a way to increase the number of characters shown to stop it getting cut

peak cipher
#

i thought it wasn't

sweet vortex
#

It can take a second sometimes

#

Or a few

peak cipher
#

yeah 😂

#

as long they appear that's fine for me

sweet vortex
#

Yeah

#

Have fun 🙂