elixir-lsp / elixir-lsp/elixir-ls

Slow Formatting on First Save of Lengthy HEEx Templates

Open
#1,106 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
1.8k
Forks
227
Avg merge
31m
Merged PRs (30d)
2

Description

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.