Home Download Buy Blog Forum Support

syntax highlighting within PHP HEREDOC not working

syntax highlighting within PHP HEREDOC not working

Postby jaredh159 on Thu Mar 08, 2012 12:48 pm

Syntax highlighting does not work in a .php page within HEREDOC for (at least) CSS and JAVASCRIPT. See below images.

Am I doing something wrong? Or is this not supported? Could it be fixed in a future release? Thanks for your help! Sublime2 is amazing, I'm in the process of switching our entire company from Textmate to Sublime.

css-heredoc-fail.png
css-heredoc-fail.png (47.15 KiB) Viewed 2103 times


js-heredoc-fail.png
js-heredoc-fail.png (49.06 KiB) Viewed 2077 times
jaredh159
 
Posts: 4
Joined: Thu Mar 08, 2012 12:39 pm

Re: syntax highlighting within PHP HEREDOC not working

Postby jaredh159 on Mon Mar 12, 2012 11:41 am

Can anyone help with this? Is there another place where technical support is provided for ST2? Am I asking in the wrong place?
jaredh159
 
Posts: 4
Joined: Thu Mar 08, 2012 12:39 pm

Re: syntax highlighting within PHP HEREDOC not working

Postby svenax on Mon Mar 12, 2012 3:34 pm

All the syntax highlighting is provided by Textmate syntax definitions, and thus not directly controlled by Sublime Text. Several of the definitions, among those PHP, are a bit out of date and should be updated at some point.

I have updated myself and get reasonable heredoc highlighting, like this:
Image

As you can see, the css highlighting is wrong in both cases.

Anyways, if you want to try updating you can find the latest Textmate syntax here: https://github.com/textmate/php.tmbundl ... r/Syntaxes

Also note that the syntax indicator in the lower right will not change if the embedded syntax changes.
svenax
 
Posts: 154
Joined: Tue Dec 20, 2011 12:47 pm

Re: syntax highlighting within PHP HEREDOC not working

Postby jaredh159 on Mon Mar 12, 2012 3:55 pm

Thanks so much for your response. I didn't realize that ST2 was using Textmate syntax definitions, and out-of-date ones at that, apparently. Updating from the link you provided improved it somewhat, but the Javascript still seems significantly off.

Correct me if I'm wrong, but shouldn't ST2 be able to detect the HEREDOC and just switch completely to a different syntax within the block? I just switched recently from Textmate, and Textmate was able to do this without a problem.
jaredh159
 
Posts: 4
Joined: Thu Mar 08, 2012 12:39 pm

Re: syntax highlighting within PHP HEREDOC not working

Postby jaredh159 on Wed Mar 14, 2012 3:07 pm

I just realized that updating to the latest Textmate php language bundle made it so that some .php files are no longer being viewed with the correct syntax highlighting, instead they're viewed as plain text, see:

plain text.png
plain text.png (132.25 KiB) Viewed 1977 times


So I need to revert to the php language bundle that came with ST2, but this means I lose the improvement in HEREDOC syntax highlighting.

Is there a solution for this? Does the application developer/s provide technical support for this product? How do we get help? Is it only through this forum? Should I be asking somewhere else?

Thanks to anyone who can help!
jaredh159
 
Posts: 4
Joined: Thu Mar 08, 2012 12:39 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 25 guests