Home Download Buy Blog Forum Support

Anyone able to help with a syntax issue or two?

Anyone able to help with a syntax issue or two?

Postby fcgrx on Mon May 13, 2013 9:54 am

I’ve overhauled and greatly improved on syntax highlighting for ExpressionEngine files in Sublime Text. In fact, I think I now have the most complete and advanced syntax highlighting for EE code that there is. Certainly way ahead of anything I’ve been able to find in any popular editor at this point. They all stumble over a whole bunch of perfectly legal and commonplace combinations of tags, often to the extent that it’s easier to just turn off color altogether.

That said, a few minor problems remain with my syntax definition (.tmLanguage file), and before releasing it, I need some help with fixing them (mainly, handling nested brackets properly).

Is anyone on this forum semi-fluent or at least extra-competent in Sublime Text syntax definitions?

If you’d be willing to pitch in on taking Sublime Text's support for ExpressionEngine development up a notch, please PM me or post to this topic and I’ll get in touch.
fcgrx
 
Posts: 23
Joined: Sat May 04, 2013 1:58 am

Re: Anyone able to help with a syntax issue or two?

Postby FichteFoll on Thu May 16, 2013 1:41 am

I have written some syntax definitions on my own and modified (or inspected) various others. (I also am enhancing AAAPackageDev to make this process even easier.)

But I think that solving all these issues via PM would be a waste since there might be other people running into similar problems where your example could help or maybe there are people who know better than me and can provide other insights.
Anyway, I recommend you to use this thread to resolve your issue. Since I replied to it I will regularly check for activity (usually multiple times a day, if I'm not out).

If you need feedback "instantly" you should hop onto #sublimetext@freenode and hope that someone's currently there for help.
FichteFoll
 
Posts: 406
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Anyone able to help with a syntax issue or two?

Postby fcgrx on Thu May 16, 2013 11:08 pm

Most of the problems I'm having require installing my current syntax and evaluating it; this seems out of scope of this forum, no?

In any case there are two representative issues, that may be reproducible by anyone with an ExpressionEngine syntax package installed:

1) EE code inside CSS (CSS definitions get messed up by EE brackets).

Code: Select all
<style>
    body{ background: {!--white--} black; }
</style>
/* THIS TEXT IS TREATED LIKE A CSS COMMENT, EVEN THOUGH IT"S OUTSIDE THE "STYLE" BLOCK ABOVE. ACTUALLY, ALL LAYOUT IS BROKEN FROM HERE ON OUT, DUE TO THE THE CLOSING BRACKET OF THE EE COMMENT ABOVE, WHICH IS INTERPRETED AS A CLOSING TAG FOR THE body DEFINITION THAT IT'S CONTAINED WITHIN. THE CLOSING STYLE TAG IS IGNORED, AND EVERYTHING AFTER IS TAGGED AS IF IT'S INSIDE A STYLE BLOCK. ONLY WAY TO RESTORE ORDER IS TO ADD THE ADDITIONAL END STYLE TAG BELOW.  */
</style>

Possible solution: inject EE definition (at least comments) into CSS and JS and PHP syntaxes?? Or use Matching Nested Constructs feature of regex


2) EE comments and tags contained within quoted strings are not properly tagged as such:

Code: Select all
<a href="{path=blog}{!-- COMMENT --}">title</a>


3) EE tags nested within EE tags are not handled right. Use Matching Nested Constructs feature of regex?
Code: Select all
{encode="{webmaster_email}" title="Contact Us"}


OK... any ideas?
Last edited by fcgrx on Sun May 19, 2013 1:33 am, edited 1 time in total.
fcgrx
 
Posts: 23
Joined: Sat May 04, 2013 1:58 am

Re: Anyone able to help with a syntax issue or two?

Postby FichteFoll on Fri May 17, 2013 12:06 am

Yeah, it would be really nice to actually have *your* current syntax. Also, there seem to be several EE packages on Github. Could you upload or link it so I can see what this is all about?

And no, this is totally fine on the forum. If people don't want to take the effort to install a package and test it themselves then they don't have to. However, if they do want and you make it hard for them to get relevant information about your issue they probably won't bother about your issue and continue with the next thread. At least that's what I think and practice.

Disclaimer: I don't know what EE is supposed to be as of now, could easily read into that though - probably. Anyway, I'll be away over weekend so next reply from me won't happen earlier than Monday or Tuesday.
FichteFoll
 
Posts: 406
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Anyone able to help with a syntax issue or two?

Postby fcgrx on Fri May 17, 2013 1:44 am

There are indeed several packages on github. I tested them all and found no significant differences between any of them, at least with regard to solving the problems I've encountered.

I have not committed most of my changes to github yet, but you can download my early commits here:

https://github.com/fcgrx/ExpressionEngi ... t-3-Bundle
fcgrx
 
Posts: 23
Joined: Sat May 04, 2013 1:58 am

Re: Anyone able to help with a syntax issue or two?

Postby fcgrx on Wed May 22, 2013 4:54 am

OK Ive not sync'ed all my changes with this github repo:

https://github.com/fcgrx/ExpressionEngi ... t-3-Bundle

There's a "known problems" file in the repo now, listing the remaining shortcomings of the package:

https://github.com/fcgrx/ExpressionEngi ... blems.html

I'd really appreciate any insight anyone might have to solving those remaining issues (i.e. the original purpose of this thread).

Anyone who got here by searching for syntax highlighters for ExpressionEngine, I do believe this one is now by far the most comprehensive and accurate...
fcgrx
 
Posts: 23
Joined: Sat May 04, 2013 1:58 am

Re: Anyone able to help with a syntax issue or two?

Postby bossanova808 on Wed Jun 05, 2013 1:44 am

Just a quick note - thanks for this. Seems to be working well for the most part.

And for the theme too.

One thing I notice - the / in /exp:stash:set, for example, is purple for me ( as I changed ee tags to purple by:

Code: Select all
      <dict>
         <key>name</key>
         <string>EE tag</string>
         <key>scope</key>
         <string>ee.tag.html</string>
         <key>settings</key>
         <dict>
            <key>foreground</key>
            <string>#AE81FF</string>
         </dict>
      </dict>


...I'd like that slash to be orange as well...but can't quite figure out which bit this is!

(would be great if Color Highlighter worked for ST3 but that's another story...)

Any tips??
bossanova808
 
Posts: 3
Joined: Wed Jun 05, 2013 12:54 am

Re: Anyone able to help with a syntax issue or two?

Postby bossanova808 on Wed Jun 05, 2013 1:49 am

Also some embedded SQL highlighting would be an awesome addition ;)
bossanova808
 
Posts: 3
Joined: Wed Jun 05, 2013 12:54 am

Re: Anyone able to help with a syntax issue or two?

Postby fcgrx on Thu Jun 06, 2013 8:15 am

bossanova808 wrote:Just a quick note - thanks for this. Seems to be working well for the most part.

And for the theme too.

One thing I notice - the / in /exp:stash:set, for example, is purple for me ( as I changed ee tags to purple by:

Code: Select all
      <dict>
         <key>name</key>
         <string>EE tag</string>
         <key>scope</key>
         <string>ee.tag.html</string>
         <key>settings</key>
         <dict>
            <key>foreground</key>
            <string>#AE81FF</string>
         </dict>
      </dict>


...I'd like that slash to be orange as well...but can't quite figure out which bit this is!

(would be great if Color Highlighter worked for ST3 but that's another story...)

Any tips??



I updated the syntax to highlight the end slash of exp:stash:set and other addons. enjoy...
fcgrx
 
Posts: 23
Joined: Sat May 04, 2013 1:58 am

Re: Anyone able to help with a syntax issue or two?

Postby fcgrx on Thu Jun 06, 2013 8:16 am

bossanova808 wrote:Also some embedded SQL highlighting would be an awesome addition ;)



not sure what youre talking about... an example would help
fcgrx
 
Posts: 23
Joined: Sat May 04, 2013 1:58 am

Next

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 4 guests