Pilgrim
I’ve got elixir-mode and eglot configured in my emacs.d and it mostly works. One thing I can’t figure out though is how to work with the code completion (via company) in elixir code.
Say I type defm at this point I get the completion options pop up. I select defmodule and then it expands to
defmodule $1 do
$0
end
But the cursor (point) moves to the end of end. I get no opportunity to specify the module name and also complete the module body.
When I disable eglot and use only elixir-mode I get the expected behaviour were selecting defmodule from the completion list places the cursor (point) between defmodule and do where I type the module name then another tab places the cursor inside the module body.
What is the way to work with what seems to be eglot’s way of code completion?
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
rodrigues
@Pilgrim I couldn’t reproduce this bug. Running latest eglot in elpa, and elixir-lsp/elixir-ls (more updated fork at the moment). When I hit enter on defmodule completion, works as expected: cursor at module name, and tab goes to module body.
I wonder if you have a
companyissue, or with another package.Pilgrim
@rodrigues can I take a look around your
emacs.d? My company config is really simple below and I spent hours going over it without success.Eglot currently is setup like so
and Elixir’s looks like this:
rodrigues
@Pilgrim my emacs.d repo gets constantly rebased with GitHub - purcell/emacs.d: An Emacs configuration bundle with batteries included · GitHub
Other than that, that’s my only company specific custom config:
As for eglot/elixir, there it is, at the moment:
mpmiszczyk
I run into same issue with my Emacs setup, and I was able to solve it.
Based on the github issue I was able to deduce that Eglot upon start communicates to Language Server that he supports snippets, and I would guess, that based on this start-up info it will either try to pass it into snippet engine or not. You could look into your
*EGLOT (....) events*buffer; find first message ( withM-<), and verify your settings.I was able to achieve such setup by installing Yasnippets, and turning them on in
elixir-mode