Elixirls: slow input when using treesitter (was: slow input when using LSP)

Hi, i have a minimal lspconfig with coq_nvim with elixirls and tsserver.
The problem is that whenever i code on elixir everything becomes slow.

Everything means:

  • Auto Complete
  • Jumping to defenitions (sometines doesnt even work)
  • changing from COMMAND to INSERT (I had to disable to elixirls or i couldn’t code at all)

What i tried

  • use minimal config (only lspconfig and elixir nothing else)
  • compile elixirls myself
  • update all deps
  • compile neovim from source

and none of the above is working for me. can anyone help me?

ill try some old builds for elixir and erlang.

None of that i can think of fixed the issue. need help :sob:

Can you try without coq_nvim?

@mjlbach hey thanks! i tried nvim-cmp but the results are the same.

anything else i can try?

i updated my dotfiles repo with the latest config My dotfiles

A priori, there is nothing in the built-in client that should cause “slowness” regardless of lag in language servers (without autocompletion).

I can’t reproduce your issue in a test container. You can try it out with:
podman run --rm -it docker.io/mjlbach/try.nvim:slim-elixir (or s/podman/docker)

Dockerfile here

1 Like

i can confirm that on docker it does not slow down at all :thinking:
do you think this could be an cpu architecture problem? since i’m on macbook pro with m1.

I don’t think so, I imagine it’s something with your environment or config. I would try removing all plugins, start with the minimal init.lua from lspconfig (or the one I included in the link above) and see if you can reproduce. You can also try using the same elixirls build I used.

I just tried your config and everything is working perfect lol.
it is indeed my configs… not sure where tho.

ill do some checks thank you <3

1 Like

I would be curious if you find a culprit. I’ve been experiencing slowness with Elixir and the native LSP.

I noticed a few things so updating this.
In my case one problem is enabling coq_nvim or nvim-cmp makes the neovim extremely slow.
But for somehow after a few minutes it gets better :thinking:

And digging some fun stuff i also found out that when the neovim is extremely slow and if i keep scrolling through the code i get TS parse error which i opened:

But the grammer it self doesn’t seems to be the actual problem here.
Also, none of other languages such as tsserver have this problem except for elixir.

Currently I’m trying to figure out who(which plugin) is the atual problem. any ideas?

So, disabling elixir’s grammer for treesitter fixes the extremely slow problem. now i’m not sure what to do here.

i can’t even tell if this is an issue or its just me.

Actually, without coq or cmp enabled, treesitter + elixir grammer works fine.
enabling coq or cmp + treesitter and elixir’s grammer gets extremely slow.
omg… i’m so lost…

I’m seeing something similar. I disabled highlighting of Elixir files and things went back to relative normal.

local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
  return
end

configs.setup({
  -- ...
  highlight = {
    enable = true, -- false will disable the whole extension
    disable = { "elixir" }, -- list of language that will be disabled
    additional_vim_regex_highlighting = true,
  },
  -- ...
})

This is a known issue with Tree-sitter (not Neovim).

Even though the issue is still open, the TS developers have made a number of improvements recently. I haven’t experienced any performance problems since switching to Neovim HEAD, which (I believe) includes those updates.

I was having the same issues. I upgraded to neovim 0.7 and it fixed it for me.