Sublime Forum

Shell heredoc syntax highlighting in ruby seems to be broken

#1

shell code in a ruby heredoc like this does not get syntax highlighted:

<<~SHELL
    echo foo  >> bar.log
SHELL

The same shell code in a .sh file in bash mode does get syntax highlighted.

Other code (e.g. SQL) in a ruby heredoc does get syntax highlihted.

Looks like there was some activity related to this recently: https://github.com/sublimehq/Packages/pull/2054/files#diff-6d068213ca5be69c03f9061b7bfd2800R72-R77

I’m on 3.2.2. Maybe I need to be on dev builds to get that fix?

Thanks for any ideas!

0 Likes

#2

You could also download the Ruby.sublime-syntax from the upstream packages repo and place it into <Data>/Packages/Ruby to overload the builtin syntax definition.

You might just want to keep in mind to remove it as soon as the next ST release is published to not stick with this certain version.

1 Like