Sublime Forum

Mixing modes (expressionengine and JS or PHP)

#1

i’m using a package for expressionengine syntax support. it works OK but it doesnt handle when youre mixing syntaxes like this:

JAVASCRIPT FILE:

{!-- THIS IS AN EXPRESSIONENGINE COMMENT BUT THE SYNTAX HIGHLIGHTER DOESNT RECOGNIZE IT --} $('#field').addClass('foo'); $('#field').addClass('f{!-- ALL HELL BREAKS LOOSE --}oo'); {if logged_in} $('#field').addClass('loggedin'); {/if}
you can either let the file default to javascript syntax and it does a bad and confusing job of highlighting, OR set the format to ExpressionEngine in which case it recognizes the comments for what they are but then you cant take advantage of javascript autocompletion…

any idea how to approach this issue?
especially in a way that doesnt require hacking files that may get overwritten with future updates of packages?

0 Likes