Skip to content

Slow Formatting on First Save of Lengthy HEEx Templates #1106

Open
@Kurisu3

Description

@Kurisu3

Environment

  • Elixir & Erlang versions (elixir --version):
    Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]
    Elixir 1.15.7 (compiled with Erlang/OTP 26)
    Phoenix installer v1.7.10

  • VSCode ElixirLS : version: 0.19.0

  • Operating System Version: Ubuntu 22.04

Repro

  1. Create a new Phoenix 1.7 project (mix phx.new demo) or use an existing one and follow the steps below.
  2. Open the project in vscode and create an empty HEEx file with the path demo/lib/demo_web/controllers/page_html/empty.html.heex.
  3. Paste inside that HEEx template the content of the following file: https://github.com/Kurisu3/blabla/blob/main/lib/blabla_web/controllers/page_html/very_long_content.txt. It's a sample of the free admin dashboard (https://github.com/VojislavD/TailwindCSS-Alpine.js-Template). You could also copy any long html content from there and paste in the empty HEEx template you created in step 2.
  4. Now save the empty.html.heex.

It takes almost 10 minutes for the formater to finish the formating. But this is only for the first formating. Of course If paste another lengthy content as above, it will take again a long time to format it when saving.

I will be happy to provide any other details. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions