Git Product home page Git Product logo

Comments (13)

cvkmohan avatar cvkmohan commented on September 2, 2024 2

Sure guys, I can take a look on it 👍
It looks like the elixir-ls module does not use mix format as in this discussion elixir-lsp/vscode-elixir-ls#224
A fresh issue has been created here elixir-lsp/elixir-ls#660

from heex_formatter.

cvkmohan avatar cvkmohan commented on September 2, 2024 1

You need to run mix compile also before running mix format.

          <%= live_patch to: @return_to,
                class: "absolute top-6 right-6 text-gray-400 flex space-x-1 items-center",
                aria_label: "close modal",
                id: "close-modal-button" do %>
            <span class="text-sm">(esc)</span>
            <.remix_icon icon="close-line" class="text-2xl" />
          <% end %>

the above piece of code is giving the error. The error message is expected attribute name

from heex_formatter.

feliperenan avatar feliperenan commented on September 2, 2024 1

Hi @krushi123 👋🏻

Yes. You need to run mix compile after adding it as a dependency. Also, this project is not yet able to process eex clauses. We are on it right now 🙌🏻

from heex_formatter.

feliperenan avatar feliperenan commented on September 2, 2024 1

@krushi123 Eex tags are supposed to be formatted now. There are still some cases to be covered but feel free to give it a try and report any other issue you have 🙌🏻

from heex_formatter.

cvkmohan avatar cvkmohan commented on September 2, 2024 1

Thanks @feliperenan and @paulo-silva for all the effort. It is working well for the eex tags.
One case that I have observed is - if there is a html attribute with no value, the formatter is failing. For example autofocus attribute is not a key-value pair. That scenario is breaking the formatter.

from heex_formatter.

feliperenan avatar feliperenan commented on September 2, 2024 1

@cvkmohan thanks for reporting this. Feel free to open issues for such cases so we will fix them as we go.

It is supposed to work on save as it does for mix format. I'm not VScode user myself, so I can't provide much help here. Maybe @paulo-silva has some idea? 🙌🏻

from heex_formatter.

paulo-silva avatar paulo-silva commented on September 2, 2024 1

Sure guys, I can take a look on it 👍

from heex_formatter.

feliperenan avatar feliperenan commented on September 2, 2024 1

@cvkmohan BTW, this commit 098f3a8 fixes the issue with attributes without values.

from heex_formatter.

cvkmohan avatar cvkmohan commented on September 2, 2024 1

I confirm that it is working. I will continue using it, and open issues if I find any. Thanks for the prompt responses.

from heex_formatter.

feliperenan avatar feliperenan commented on September 2, 2024 1

It was there but we removed by accident I guess. Let's add it back.

from heex_formatter.

cvkmohan avatar cvkmohan commented on September 2, 2024

A small addon question. If I am using vscode as the editor and elixirLS extension - formatOnSave is working for a regular elixir code. It is not working the same for heex formatting. How to enable that?

from heex_formatter.

paulo-silva avatar paulo-silva commented on September 2, 2024

yeah, I was about to link it here 😅, thanks @cvkmohan for all your help opening issues so far, so probably soon we will be able to auto-format in vscode 😄

from heex_formatter.

nicocirio avatar nicocirio commented on September 2, 2024

Hi @krushi123 👋🏻

Yes. You need to run mix compile after adding it as a dependency. Also, this project is not yet able to process eex clauses. We are on it right now 🙌🏻

Great job! this formatter is really great! 🚀

Have been trying to solve Skipping formatter plugin HeexFormatter because module cannot be found error, and mix compile fixed the issue. Perhaps this step could be added to README.md?

from heex_formatter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.