Nefcairon
Hello,
Should the command Code > Reformat code (Ctrl-Alt-L) oder Code > Auto-Intend Lines (Crtl-Alt-I) work with .html.eex files when using IntelliJ plugin intellij-elixir? If yes, do I have to change or set up anything?
Sorry if I should have posted in the IntelliJ Elixir - Elixir plugin for JetBrain’s IntelliJ Platform topic.
Thanks,
Peter
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
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
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Nefcairon
@KronicDeth Can you help?
KronicDeth
The formatter is registered for Elixir
https://github.com/KronicDeth/intellij-elixir/blob/88733a74968dd789b6809777626f8bd68a72562e/resources/META-INF/plugin.xml#L154
not EEx, so I think if it works at all, it would format the Elixir inside the EEx tags.
I’m not sure how formatting a whole file works since the outer (HTML) needs to be formatted, then the template tags (EEx) and then the inner (Elixir). IntelliJ Ultimate Edition, WebStorm, PHPStorm, and Rubymine have HTML formatters I think, so they should format the HTML, but I don’t think HTML support is in IntelliJ Community Edition.
So, maybe I need to register a formatter for EEx too, but I’m not sure how that would work since you can put the tags wherever, like to interpolate an attribute or even seemly invalid, partial HTML and that formatting would be dependent on the outer language.
Which IDEs have you tried Auto-Indent Lines in?
Nefcairon
@KronicDeth Thanks for your reply.
I’m using IntelliJ Idea’s Ultimate Version. Trying ‘auto-intend lines’ and nothing happens on html.eex files. Can I register a formatter for EEx myself?
drl123
FWIW I use Rubymine for editing Elixir/Phoenix code. I had to add
*.html.eexundereexto get it to treat those as both HTML and EEX for highlighting and Zen coding HTML. However it will not respect the Elixir blocks that span<%= %>tags for reformatting or indenting. I’ve just been applying the formatting manually. I wasn’t sure if this was just a small-IDE thing or not until I saw your post. Maybe it does need a formatter registered since, unlike.exor.exsfiles, the code it separated by tags in.html.eex.It also complains that it can’t find the definition/assignment of the assigns variables and doesn’t bold the name (
@current_user, etc), but that’s just a minor inconvenience.For the most part, the plugin is awesome. Kudos to @KronicDeth for all of the great work and being so responsive to questions.
kurtome
Love the Elixir plugin so much, except for this. It’s driving me crazy that I can’t format HTML files, I’ve tried fiddling with all the options in IntelliJ and it seems to just completely ignore indenting for .html.eex files no matter what I do.
Thanks for the plugin though @KronicDeth
edit: just found the best work-around: rename the file to
.htmlfor a second, reformat it, rename it back to.html.eexJorisKok
I am using PhpStorm and got it working with adding
*.html.eexunder the Editor > File Types > Twig. As it has a similar template language style, it works like a charm.joe
If anyone ever finds a better solution than the Twig file type, please please please tell me here. It’s still driving me crazy because now I basically have the option which language it’s properly formatting but not both…
niknetniko
The Elixir plugin was recently updated to provide better formatting (as of v11.8.0). It will now use the underlying language for eex files, meaning
*.html.eexfiles will be formatted as HTML. Unfortunately, this still won’t format both Elixir and HTML at the same time. An example of what I mean:will be formatted as:
As you can see, the content inside the
ifwas not indented.drl123
I’m using it with Rubymine and if you add
*.html.eexand set the template language to HTML, it formats both the HTML and Elixir as you can see below. This has been my pet peeve for a while but seems to be resolved with the latest update!joe
On your screenshot you have set the language of *.html.eex to Embedded Elixir, no?
Your highlighting seems correct (in contrast to @niknetniko’s answer). Is that Rubymine specific? Because I want that!