Closed dylanbromby closed 10 years ago
Edit: added entry for asset:stylesheet after the update for asset:script.
Just added the entry for asset:javascript. Update your GSP.tmLanguage file with:
<dict>
<key>begin</key>
<string>(?=(<(?i:asset:javascript)))</string>
<key>comment</key>
<string>Javascript embedded in <asset:javascript /></string>
<key>end</key>
<string>(?<=</asset:javascript>)</string>
<key>name</key>
<string>source.js.embedded.html.gsp</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#embedded-groovy</string>
</dict>
<dict>
<key>include</key>
<string>#html</string>
</dict>
<dict>
<key>include</key>
<string>#js</string>
</dict>
</array>
</dict>
For embedded CSS within asset:stylesheet:
<dict>
<key>begin</key>
<string>(?=(<(?i:asset:stylesheet)))</string>
<key>comment</key>
<string>CSS embedded in <asset:stylesheet /></string>
<key>end</key>
<string>(?<=</asset:stylesheet>)</string>
<key>name</key>
<string>source.css.embedded.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#embedded-groovy</string>
</dict>
<dict>
<key>include</key>
<string>#html</string>
</dict>
<dict>
<key>include</key>
<string>source.css</string>
</dict>
</array>
</dict>
Grails 2.4 is a big release that changes how assets are loaded. JS syntax within the asset tag is not recognized/color-formatted.