Sublime Forum

3114: PHP Syntax Highlighting change?

#1

I just updated to 3114 from 3113 and am having an issue with functions in PHP not highlighting properly. Any custom defined functions or Wordpress functions are no longer highlighting appropriately. I am using the Tomorrow - Night theme so I’m curious if something in the syntax declarations changed.

In this example the following functions should be highlighted in blue.

  • get_field()
  • carbon_responsive_background_image()

Currently standard PHP functions are highlighting properly (echo, array, empty, etc), but not any custom defined functions.

Anyone else running into this?

2 Likes

#2

There seem to be a number of errors in PHP syntax highlighting (as well as Laravel Blade highlighting). Glancing at the other forum posts, it seems PHP isn’t alone.

I’ve just reverted back to the previous build for now.

1 Like

#3

Same here. In .php files that contain HTML markup, inserting PHP tags into values of HTML attributes now breaks every following HTML attribute - see attached.

I’m going to revert to the previous version as well for now… hope this will get fixed soon! Thanks Sublime team for looking into this.

0 Likes

#4

Glad to know it’s not just me!

I was hoping to revert back to 3113 as well. Anyone have a link for that build?

0 Likes

#5

To get a download url for an older version, grab the download link from the downloads page for the OS you want. You’ll see the version number at the end of the url and you can just twiddle that.

FWIW, reverting didn’t help me.

Also, it looks like 3114 has been pulled.

2 Likes

#6

I still see 3114 on the homepage and download page… where was it pulled?

Also - thanks for the URL trick!

0 Likes

#7

Odd. Yes, I see it there now too at http://www.sublimetext.com/3 but earlier it listed 3113. No, really, I swear! :wink:

0 Likes

#8

https://download.sublimetext.com/Sublime%20Text%20Build%203113%20x64%20Setup.exe

0 Likes

#10

The php closing tag isn’t behaving

1 Like

#11

This is due to the scope selector in the html_completions.py file not supporting embedded html inside control structures. https://github.com/sublimehq/Packages/blob/6ce9636d3f058c30ee4a956363398bee41f0907d/HTML/html_completions.py#L202

0 Likes

#12

Is this a change in 3113 & 3114? It works fine in 3112

0 Likes

#13

Yes, there was a change to the PHP syntax between 3112 and 3113 - https://github.com/sublimehq/Packages/commit/6ce9636d3f058c30ee4a956363398bee41f0907d

0 Likes

#14

@sjk1000 You can try using PackageResourceViewer to change line 202 in html_completions.py to:
if not view.match_selector(locations[0], "text.html - (source & - source text.html)"):

and the php.sublime-completions selector to:
source.php - variable.other.php - source.php text.html.basic

0 Likes

#15

Thanks for the info. Do I understand correctly that this fix is in the release queue already, and will be part of a future update?

0 Likes

#16

I’ve been working on a new Laravel Blade syntax that you can manually install for now. https://github.com/jbrooksuk/Sublime-Blade

0 Likes