Nefcairon

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

Showing Posts 16 to 7

benkeil

benkeil

Do you get auto completion for tailwind?

joe

joe

Sadly the autocompletion for both html feels a lot worse than it did when I had set it to twig.
When I type <div cl it used to create the rest for me <div class=""></div>.

Also my live template didn’t work anymore.

The workaround was to create it in the elixir language section and make it available for html files at the bottom.


Maybe this will help someone.

If you have an idea how to get my html autocompletion back, please share it with me.

Maybe I should make my template language into something else than html? Or change all live templates of zen html and zen css to be applicable in elixir files?

KronicDeth

KronicDeth

Thank you, @joe, but I can’t take the credit. The formatter change was actually a community contribution from niknetniko (Niko Strijbol) · GitHub. All I did was the review and merge on that one.

joe

joe

EDIT: Found an update, everything works now. Woohoo!
This is amazing. Not perfect yet, but definitely awesome.

I just donated a coffee to @KronicDeth. Thank you so much! :slight_smile:

FYI: The link if anyone else is interested: GitHub - KronicDeth/intellij-elixir: Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine) · GitHub

drl123

drl123

Yes, exactly. Select the Embedded Elixir file type and click the + sign. It will ask you for the template language and select HTML. Obviously, you’ll need to do the same for *.html.leex if using LiveView templates too. Once I do that, the syntax highlighting works and even the Emmet shortcuts for building HTML elements!

It may be RubyMine (or any small IDE) specific. I don’t have IntelliJ on this machine to check.

niknetniko

niknetniko

That should happen automatically. The highlighting is broken since it’s a code snippet, it works fine in Intellij for me:

My file types:

joe

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! :sweat_smile:

drl123

drl123

I’m using it with Rubymine and if you add *.html.eex and 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!

niknetniko

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.eex files 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:

<html>
<body>
<div>
  <%= if true do %>
    <p>Hallo</p>
    <% end %>
  <p>Test</p>
</div></body></html>

will be formatted as:

<html>
<body>
<div>
    <%= if true do %>
    <p>Hallo</p>
    <% end %>
    <p>Test</p>
</div>
</body>
</html>

As you can see, the content inside the if was not indented.

joe

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…

Where Next? Top

Trending in Questions Top

RSP87
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
kszambelanczyk
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
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
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
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
nseaSeb
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
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
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
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews