As a curiosity perhaps, I decided to run a small experiment recently. Since majority of elixir-mode is now provided by tree-sitter, I disabled Elixir layer completely in Doom, just copied relevant parts from it to my config.el. All I needed was this:
This was on top on my existing config setting up eglot with Lexical, configuring tree-sitter etc.
So far after few days I see no problems with it. It even feels a bit snappier, but that’s probably my bias. However I think it can only work in Emacs 29 and 30 (I’m using 30).
I was doing a lot of rebuilding of things with emacs this morning because I was experiencing Emacs crashes during this week at work and it was messing up my whole vibe.
It all started when I switched from elixir-mode to elixir-ts-mode ( GitHub - wkirschbaum/elixir-ts-mode: Elixir mode using Treesitter for fontification, navigation and indentation ).
It turns out that older tree-sitter versions has a memory leak in elixir-ts-mode ( bug#72863: 30.0.50; tree-sitter elixir-ts-mode hangs and memory leak on ) and my default linux install of tree-sitter was older than 0.25.
Anyway, just writing my thoughts for future reference because I will forget all this by Monday.
Remove old tree-sitter libs, probably from, e.g. /usr/lib/local.
Install tree-sitter using github repo. Use the 0.25 branch. Usual make and make install.
Check ldconfig -p | grep tree-sitt to make sure you are using the 0.25 vsn.
Install emacs using github repo. Use the emacs-30 branch. Used ./configure --with-native-compilation then make and make install.
I think that’s all of it. I am using lsp-mode with Expert LS and everything is finally smooth. Hopefully my scrawled notes will help other lost travellers.
I was experiencing an annoying thing where, for example, I was typing "for” but inside, say, a moduledoc and it was being expanded into a for do \n end snippet. This is smartparens not doing the right thing in elixir-ts-mode on Emacs 30.2.50. I am using latest libs of everything.
Anyway, I don’t have the spoons to trawl through github issues and I need to sleep so just writing down what I added to config.el to stop this annoying behaviour.