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
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











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!