Closed jurgensymynck closed 1 year ago
I have run into this issue before. The ERB ignores comments, and at the time there was no interest in changing the behavior. See #60 for reference. I believe this behavior is unintuitive and should be addressed, since it won't affect backwards compatibility, and will save many headaches as you mentioned.
Unfortunately this is just how ERB works when it processes a file. As @jurgensymynck figured out, you can comment out ERB statements with <%#
but that's both unintuitive and annoying when your editor simply comments out the entire line. I think the only way for us to handle this in COSMOS would be to pre-process the file and strip out any comment lines before running ERB. I'll look into that as a possible solution.
Hi guys,
I would argue against this workaround, because we need the comments not only in our own editor but also when reading/sharing our files in the COSMOS integrated editor...
If my original proposition of amending the <%= in a commented line is not possible to implement, than I would already be very happy with some kind of warning message during parsing like Line XXX: Warning: active ERB code in commented line
and have a paragraph on the documentation website what this means and what the side effects could be when ignoring this warning.
Greetings, Jurgen
Is your feature request related to a problem? Please describe.
Commenting out command , telemetry or screen definitions by just placing a
#
symbol in front of a line containing Ruby ERB<% ... %>
has caused me some headaches , trying to decipher unrelated error messages like "Warning TLM_XXX redefined and "Error: packet_id undefined" this example doesn't work:... but this works:
Describe the solution you'd like
<CTRL> - :
, all Ruby ERB code on that line should also be commented out, from<%= ...
to<%#= ...
gr. Jurgen