kevinsawicki / monokai

Monokai Atom Syntax theme
241 stars 133 forks source link

PHP got confused by SQL #65

Closed tap52384 closed 8 years ago

tap52384 commented 8 years ago

screenshot 2015-10-21 10 53 34

For whatever reason, the PHP syntax highlighting fails based on how crazy my SQL query is. In fact, the syntax is valid as the page loads.

svanharmelen commented 8 years ago

@tap52384 I would say this is related to the PHP language package as that one assigns the scopes. This package only gives the assigned scopes it's colours. So if you use the debugger, I think it will show you the assigned scopes are not correct...

tap52384 commented 8 years ago

I'm not sure I understand you mean. Are you saying that the issue is not with this theme, but with a built-in package for Atom? Also, when you mention a debugger, are you talking about a debugger for the Atom text editor itself or something else? If you are referring to a PHP debugger, I'm not using one that integrates with Atom at the moment. I only have the core packages installed.

svanharmelen commented 8 years ago

@tap52384 sorry, I will be a little more verbose :wink:

In the end Atom is build on top of Chromium. So if you press (on OSX) OPTION+CMD+i it will open the same Developer Tools as you'll find in the Chrome browser. Once you've done that you can inspect the source HTML generated by all different packages resulting in what you see in Atom.

The language packages (for PHP that would be this package: https://atom.io/packages/language-php) are responsible for assigning scopes to all the different parts that make up the syntax (vars, funcs, consts e.d) and the theme packages (like this package) are then assigning colours to those scopes.

So indeed I'm suggesting this is a problem with the language package as I suspect it doesn't handle this specific (corner) case correctly and so assigns the wrong scopes...

Makes sense?

tap52384 commented 8 years ago

Yes, that does make sense. Thanks for taking the time to explain. Atom and this theme is awesome. It's because of this theme that I even tried changing from Sublime Text 3 and I'm so glad I did.

svanharmelen commented 8 years ago

@tap52384 I think there already is a issue logged for this with the PHP language package: https://github.com/atom/language-php/issues/52

So closing this one for now, but of course you can always reopen it when the language package part is fixed and you still see the issue.