Hey all!
This bubbled up from what I thought was an issue in a VSCode plugin, but is actually an issue with the language:
The issue is that in the current state of the language, there is no way to toggle comments on and off sections of mixed ERL/HTML in Eex/Heex templates in a way that integrates nicely with a text editor, as the `%>` ending (for instance) a for loop will stop the commenting, leaving the contents of the loop exposed.
The same problem has existed for Ruby ERB templates for a long time and solutions have evolved as the language has matured. There was originally a `=begin` and `=end` syntax (ex: `<%
=begin %> <% ruby_code %>
<%
=end %>`), but I think people found this is kind of clunky. Another strategy was to use `<% if false %><!-- start erb comment --> .. <!-- end erb comment --><% end %>`, but again, this looks weird.
A convention developed to define an empty 'comment' method in the application, as Jose suggests in issue 1761 above, so one can do `<% comment do %>..<% end %>`, however as this is a convention not a requirement, it will work but likely won't change to grey in a text editor.
I think it'd be great if we could standardize this convention, perhaps as `<.ignore>..</.ignore>', into the language itself, so that all of the syntax highlighters/language servers can implement something that works for everybody.
Thoughts?
Cheers!,
Rich