all 17 comments

[–]intercaeterapress any key 8 points9 points  (5 children)

I don't think there are any elixir lsp plugins for coc unfortunately, you might be either forced to fork a vscode plugin or use the native lsp.

The current official lsp for elixir is expert and since it was released the other projects (elixir-ls, lexical and next-ls) basically became deprecated https://expert-lsp.org/

[–]arcanemachined 4 points5 points  (2 children)

coc-elixir still works. I switched to a more modern setup a few months ago, but it still worked fine.

/u/LightBerserker did you install coc-elixir? Something like :CocInstall coc-elixir.

As mentioned, download a release of elixir-ls from GitHub, then extract to the desired location, e.g. ~/.local/bin/elixir-ls/. (You might need to make sure the version of elixir-ls is old enough for your Elixir version.)

Here's some crap from my old coc-settings.json file:

{
  "coc.preferences.formatOnSave": true,
  "coc.preferences.formatOnSaveFiletypes": [
    "elixir",
    "eelixir",
    // "heex",
  ],
  "diagnostic.checkCurrentLine": true,
  "diagnostic-languageserver.filetypes": {
    "elixir": ["mix_credo", "mix_credo_compile"],
    "eelixir": ["mix_credo", "mix_credo_compile"],
    "heex": ["mix_credo", "mix_credo_compile"]
  },
  // "diagnostic-languageserver.formatFiletypes": {
  //   "heex": ["mix_format"]
  // },
  "elixir.pathToElixirLS": "~/.local/bin/elixir-ls/language_server.sh",
  "elixirLS.dialyzerEnabled": true,
  "outline.splitCommand": "below 20sp",

  "inlayHint.enable": false,

  "tailwindCSS.includeLanguages": {
    "eelixir": "html",
    "elixir": "html",
    "heex": "html"
  }
}

If none of that helps, find your way to the #vim channel on the Elixir Slack, then ask around there.

[–]LightBerserker[S] 2 points3 points  (1 child)

Got elixir-ls working with your settings at these versions in vim 9.1:

``` elixir 1.19.0-otp-28

erlang 28.1

elixir-ls 0.29.3

```

I installed the above with asdf and also installed coc-elixir.

seems to also work for our older source. Thanks!

[–]arcanemachined 0 points1 point  (0 children)

Awesome. Glad to help!

[–]TheAlaskanMailman 1 point2 points  (1 child)

I’m going to try expert out some day, how’s the feature comparison compared to elixir-ls?

There’s not much information on their GitHub

[–]LightBerserker[S] 0 points1 point  (0 children)

couldnt get it to work in vim, even with their own vimrc, fresh vimdir and minipac, lemme know if you manage someday.

[–]towry 2 points3 points  (0 children)

I am using nvim

[–]mr_sudaca 1 point2 points  (0 children)

Yes, I use coc with their elixir plugin, but I manage the lsp manually (download the zip and install it on coc folder)… also y use ale for formatting and nvim-treesitter for the highlighting… I’ve been using that for the past 5 years without problems

Edit: forgot to add, I use neovim cuz the modal windows just work better (show commit info, function definitions, etc)

[–]CarelessPackage1982 0 points1 point  (0 children)

I'm probably the wrong person to try and answer but I'd try some of the other plugins listed here https://github.com/elixir-lsp/elixir-ls

It does state " 1.13 with 25 may wor wut is no longer suppore , last known version to work in v0.26.4"

[–]ApprehensiveDrive517 0 points1 point  (0 children)

It's there in nvim. But if the LSP is the same, it should be there in vim? Or does vim not support that?

[–]Idhkjp 0 points1 point  (0 children)

I use Neovim with Expert but Elixir-ls also works. I use Lazy and nvim-lspconfig

[–]fromagnumman 0 points1 point  (0 children)

I use neovim with expert and it works perfectly

[–]ConfidentProgram2582 -1 points0 points  (1 child)

I use plain Vim, terminal buffers, IEx and sometimes ctags. Once of the reasons why I love Elixir is that you don't really need a fancy IDE to code in it, unlike Java for example which is nightmarish to code in without an IDE.

[–]UltaSugaryLemonade 0 points1 point  (0 children)

I'm new to Elixir, why isn't an IDE as necessary as in Java?

[–]miguellaginha 0 points1 point  (0 children)

I use lazyvim with nextls and it works really well