Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Formatting is broken when using simple {} #1347

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

angelozerr
Copy link
Contributor

fix: Formatting is broken when using simple {}

Fixes #1345

@angelozerr
Copy link
Contributor Author

@ia3andy we have a bug with the Qute IntelliJ parser that I have fixed (need to play more with this fix and need to write tests for this Qute IntelliJ parser).

The fix allows to consider that Qute section tag are closed correctly and now it is considered as HTML Text node.

With the fix:, HTML element should be correctly indented, but as Qute section as considered as HTML Text node, the section cannot be indented, is it annoying?

Given this Qute template:

<div>
<div>
                    {#if}
    {#if}
                {inject:flash.get("key")}
<form>
        </form>
        {/if}
                    {/if}
                        </div>
    </div>

After formatting:

<div>
    <div>
        {#if}
        {#if}
        {inject:flash.get("key")}
        <form>
        </form>
        {/if}
        {/if}
    </div>
</div>
  • HTML elements are correctly indented:
  • Qute section are indented by using the HTML text node strategy format. As you can see all Qute section are idented with the same indent. Is it enough @ia3andy ?

Indenting Qute section is not trivial to do, we could do that in an another PR, but @ia3andy do you think it is enough for you?

@ia3andy
Copy link

ia3andy commented Jun 29, 2024

It's perfect 🤩 please make it available for 8 of July :)

@angelozerr
Copy link
Contributor Author

@ia3andy you can play with this PR by downloading thezip at https://github.com/redhat-developer/intellij-quarkus/actions/runs/9722616563, see expalanation at https://github.com/redhat-developer/intellij-quarkus?tab=readme-ov-file#testing-the-ci-builds

It should install https://plugins.jetbrains.com/plugin/23257-lsp4ij/edit too I think otherwise you will need to install it.

@ia3andy
Copy link

ia3andy commented Jun 29, 2024

ok will there be a release before 8 of july? (I have a lab)

Copy link

@ia3andy ia3andy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!!!!

It's amazing :)

quarkusio/quarkus-web-lab@0e78d8f

@ia3andy
Copy link

ia3andy commented Jul 1, 2024

a new release with this in please 🙄

@angelozerr angelozerr force-pushed the format_qute_fix branch 2 times, most recently from 98bedac to d6457a3 Compare July 1, 2024 14:57
@angelozerr angelozerr marked this pull request as ready for review July 1, 2024 14:57
@angelozerr angelozerr merged commit b945502 into redhat-developer:main Jul 1, 2024
6 of 7 checks passed
@angelozerr
Copy link
Contributor Author

It's amazing :)

That's great! Thanks @ia3andy for your patience and to have tested the IJ plugin of my PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Formatting is broken when using simple {}
2 participants