These are chat archives for opal/opal

21st
Sep 2018
Jan Biedermann
@janbiedermann
Sep 21 2018 11:26
https://youtrack.jetbrains.com/issue/RUBY-22559 syntax highlighting for embedded js for RubyMine, maybe thats useful :smiley:
Jan Biedermann
@janbiedermann
Sep 21 2018 11:37
with solution
Ilya Bylich
@iliabylich
Sep 21 2018 12:38
@janbiedermann Some editors highlight heredocs with special identifiers using rules for these IDs, for example, Sublime highlights heredocs with RUBY identifier as a ruby code. Heredocs also can be xstrings if ID is wrapped with backticks, so this may work for your editor:
<<`JS`
  function() { return 1 }
JS
It still compiles to what you'd expect:
bin/opal -c --no-opal --no-exit test.rb
/* Generated by Opal 0.11.1.dev */
(function(Opal) {
  var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice;

  return   function() { return 1 };
})(Opal);
Jan Biedermann
@janbiedermann
Sep 21 2018 13:15
nice, thanks