atom-elixir-formatter icon indicating copy to clipboard operation
atom-elixir-formatter copied to clipboard

Formatter does not save heex files

Open arnimikelsons opened this issue 2 years ago • 7 comments

I upgraded to the latest and greatest, but the Formatter does not allow saving of .heex files, getting this errror:

mix format failed for file: lib/farmemerg_web/live/response_live/index.html.heex ** (SyntaxError) lib/farmemerg_web/live/response_live/index.html.heex:1:1: syntax error before: '<' (elixir 1.12.2) lib/code.ex:978: Code.format_string!/2 (mix 1.12.2) lib/mix/tasks/format.ex:418: Mix.Tasks.Format.format_file/2 (elixir 1.12.2) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2 (elixir 1.12.2) lib/task/supervised.ex:35: Task.Supervised.reply/5 (stdlib 3.15.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

The first line is:

File heading

it does save if you remove the formatter.

arnimikelsons avatar Jul 17 '22 12:07 arnimikelsons

Thanks for the bug report @arnimikelsons. Are you seeing this issue on all heex files or just one in particular?

rgreenjr avatar Jul 18 '22 21:07 rgreenjr

@rgreenjr I am seeing it on every file. I had turned formatting off for now, but it is also on .eex files as well.

arnimikelsons avatar Jul 18 '22 21:07 arnimikelsons

@arnimikelsons I reverted support for heex files and published v2.2.0. However, the Atom packages API server continues to have issues, so I'm not sure if this updated version will be visible. Please let me know if you are able to see the new release.

rgreenjr avatar Jul 18 '22 23:07 rgreenjr

I see it it in the list, but when I try to install I get:

Installing “[email protected]” failed. Package version: 2.2.0 not found

arnimikelsons avatar Jul 19 '22 11:07 arnimikelsons

Good news: it looks like v2.2.0 is now available. I uninstalled my current version of the pacakge, restarted Atom, and was able to install 2.2.0 successfully. Hopefully, you will be able to get the same result.

rgreenjr avatar Jul 20 '22 22:07 rgreenjr

I wonder why this happens, I can't reproduce it on my projects.

benonymus avatar Jul 22 '22 10:07 benonymus

So, editing heex or eex files, they are saving, but the error still pops up. I actually don't know if what I reported before was saving and just popping up the error, or if it actually wasn't saving.

arnimikelsons avatar Jul 22 '22 13:07 arnimikelsons