SublimeText / CoffeeScript

Syntax highlighting and checking, commands, shortcuts, snippets, watched compilation and more.
440 stars 64 forks source link

Add support for interpolated_coffee within underscore templates (<% %>) #154

Closed philippotto closed 10 years ago

philippotto commented 10 years ago

I added support for interpolated coffeescript code within underscore templates (<% %>).

Before: without_interpolation

After: with_interpolation

Unfortunately, in order to make it work, the user has to modify his tmTheme (unless, the theme was already modified).

For those who are interested, the necessary additions for the Monokai theme are:

        <dict>
            <key>name</key>
                    <string>Embedded Punctuation</string>
            <key>scope</key>
                    <string>string punctuation.section.embedded</string>
            <key>settings</key>
            <dict>
                    <key>foreground</key>
                    <string>#F92672</string>
            </dict>
        </dict>

        <dict>
            <key>name</key>
                    <string>Embedded CoffeeScript Source</string>
            <key>scope</key>
                    <string>string source.coffee.embedded.source</string>
            <key>settings</key>
            <dict>
                    <key>foreground</key>
                    <string>#FFFBF7</string>
            </dict>
        </dict>

        <dict>
            <key>name</key>
                    <string>Strings in Embedded CoffeeScript Source</string>
            <key>scope</key>
                    <string>string source.coffee.embedded.source string</string>
            <key>settings</key>
            <dict>
                    <key>foreground</key>
                    <string>#E6DB74</string>
            </dict>
        </dict>
aponxi commented 10 years ago

Thanks!