I haven’t hit upon the correct setting to solve the annoying problem in the image above: when snippets complete, tabs are inserted instead of spaces. I’ve tried a few things including verifying that indent-tabs-mode is nil. I’ve also tried toggling lsp-enable-indentation but that setting has no effect. I’m using doom-emacs with emacs-lsp and elixir-ls. It’s working really well, except for this issue.
Hmmm, if you’re using a recent version of ElixirLS (0.5.0 or master) then the do end is not inserted by ElixirLS but instead by yasnippet. Do you have ~/.emacs.d/.local/straight/repos/doom-snippets/elixir-mode/do on your machine? Does it have a tab character?
If you’re using an earlier version of ElixirLS the do end snippet was removed in:
I have yasnippet installed and yasnippet-minor-mode is enabled. When I run yas-insert-snippet I get the output I prefer. However, lsp-mode is picking the snippets from ElixirLS by default (see screenshot below). I do notice there’s a tab in those snippet definitions. But that doesn’t seem to be an issue in VS Code, only in Emacs.
I’ve looked around for a way to force lsp-mode to prefer yasnippets, but haven’t hit upon the right config just yet. It’s not so bad, since I’m formatting the buffer on save - and I save a lot.