<.ignore>..</ignore> still looks like a component, I guess because it is.  
<.#> </#>?  <%!-- ... --%>? Is it even possible to wrap other eex tags 
inside, like <%!-- <% for x <- y do %> ... <% end %> ... --%>?  

We have {!-- ... --} in Surface which I use all the time.

On Friday, 19 November 2021 at 7:29:05 pm UTC+8 José Valim wrote:

> Something like <.ignore>..</.ignore> would not be specific to the 
> language (EEx knows nothing about HTML) but HTML specific. Something like 
> ERb's would be EEx specific, so we would need to decide which solution we 
> want. If our preference is on tags, then this should go back to LiveView. :D
>
> On Wed, Nov 17, 2021 at 2:37 PM Rich Jones <mise...@gmail.com> wrote:
>
>> Hey all!
>>
>> This bubbled up from what I thought was an issue in a VSCode plugin, but 
>> is actually an issue with the language:
>>
>> https://github.com/elixir-lsp/vscode-elixir-ls/issues/215
>> https://github.com/phoenixframework/phoenix_live_view/issues/1761
>>
>> 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
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to elixir-lang-co...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elixir-lang-core/fe426ec4-43b7-4a05-bab6-6075240d0713n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/elixir-lang-core/fe426ec4-43b7-4a05-bab6-6075240d0713n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/e8ebe2c7-9500-4919-b89f-a9a5b18f710dn%40googlegroups.com.

Reply via email to