Sublime Forum

Build 3143 PHP syntax degradation?

#1

PHP syntax highlighting is a bit harder to ‘read’ now. In the example, the ‘->’ and function calls (like orderRandom()) were highlighted in red and blue respectively. Now it’s all white. Is this a permanent change?

0 Likes

#2

Apparently yes, as I asked a while back: Dev Build 3132

1 Like

#3

Nothing is permanent these days :wink: The syntax packages have been open sourced and they accept community contributions. If you want to make changes please submit a PR and it will be reviewed and added for future releases:

1 Like

#4

The Monokai color scheme is mostly set in stone now, because of popular usage, but the syntaxes are being evolved.

You may wish trying the new Mariana color scheme, or one of the light options. I believe they all color accessors differently than identifiers.

1 Like

#5

Let me provide some more detailed explanation on that.

Much effort was spent to the default syntax files to

  • introduce or use as many common scopes as possible.
  • reflect the grammar of a language and target its entities as exact as possible

The big goal is a minimum set of common scopes, which need to be addressed by color schemes to create the same experience for all available (default) languages.

In the past many syntaxes came with a unique set of scopes. Therefore many beautiful color schemes work properly for single languages only.

These breaking changes in scoping require many color schemes to be updated in order to support all the new stuff. This might take a while, but hopefully most of the devs of the most popular ones are willing to do so.

But I am convinced of these changes will help to create a more common color scheme experience independent from the syntax you are using.

A good starting point to to learn about the least required set of scopes to be addressed by color schemes can be found at https://www.sublimetext.com/docs/3/scope_naming.html

0 Likes

#6

In particular:

The -> accessor probably used to be marked as keyword.operator. This is not really correct. Now, it’s marked as punctuation.accessor. However, your color scheme (presumably Monokai) does not highlight the punctuation scope. The same is true of the function names, which are now marked as variable.function.

You can fix this by either customizing Monokai or using a different color scheme. Myself, I moved from Monokai to the new built-in Mariana scheme, which has up-to-date support for the scoping standards. (Actually, I still customized it because I found the colors a bit dull.)

2 Likes

#7

ThomSmith - i switched over to Mariana color scheme and you’re right, looks to be up-to-date. You’re also right that the color scheme is a bit dull by default, but well worth the trade off due to code readability.

Thanks for the help!

0 Likes

#8

For all who like Monkai, try MonokaiFree. It is based on default Monokai but supports most/all of the new scopes.

4 Likes

#9

Hi, I’m the author of MonokaiFree. Some of the issues you highlight have been fixed. Please open issues and I promise I will fix them, both for the color scheme itself and underlying default syntax.

There is a solid test suite using ColorSchemeUnit, which I also develop, so I am very familiar with it and so it’s easy for me to fix issues without breaking support for other languages.

So please, fire away and open issues

2 Likes