Improving Semantic Coloring

I have improved the semantic coloring in the PHP editor this week. In this case one picture is much better then many words.


Sweet. I would only change a few things.
- Line 5: The unused field's name should be green like the other fields, but still with the gray squiggle underlining it.
- Line 15: The unused method's name should be bold like the other methods, but still with the gray squiggle underlining it.
- Line 23: The static method's name should be italicized.
- Throughout: Maybe treat $this like a keyword and color it blue. Eh, maybe not.

Posted by Mark on July 11, 2008 at 11:03 AM CEST #

I actually don't like to the way class declaration is aligned, compared to <?php column. This is not PHP way at all. The class keyword should be aligned in the same column as in <?php line

Posted by pcdinh on July 11, 2008 at 02:11 PM CEST #

I agree with mark, also i'd suggest that the squiggles have some attention getting colors which indicate severity (ie warnings, errors, info)

Can the "<?php ?>" pair be something like red so that its easy to see when mixed with html to sort of let you know the boundaries of where the code starts and ends

Posted by Gerry on July 11, 2008 at 09:27 PM CEST #

What OS and Look & Feel you are using for NetBeans Build?

This looks really cool :-)

Posted by Varun on July 12, 2008 at 03:00 AM CEST #

I agree with pcdinh, i would like php code align in same column as <?php .. is there anyway to configure ?

Posted by Anton Heryanto Hasan on July 12, 2008 at 04:42 AM CEST #

Thanks to all for the comments. I have wrote new entry , where I reflect every comment for this entry.

To Varun: I use Ubuntu 8.04, Gnome. I changed a little the standard theme (Controls: Industrial, Window Border: Mist).


Posted by Petr on July 13, 2008 at 08:42 AM CEST #


How about highlighting the parenthesis then the cursor place between them?


function "("$name,$age|,$color")" {}
// when cursor is inside represented by "|" then
// the outer brackets will be highlighted represented by "(" and ")"

The same can be applied for {} brackets

function ($name,$age,$color) "{"
// some code here
$name[] = $name;| // <- cursor here

Posted by raymond on July 21, 2008 at 09:13 AM CEST #

Hi Raymond,

there is functionality, which highlights the parenthesis. It doesn't work as you describe, but when you place cursor after ( or ) in your case then the opposite bracket is highlighted. The same is for { } and [].

Also what I use very often is CTRL+[ shortcut, which jumps just after the opposite bracket. With SHIFT combination, it selects the content beetween the brackets. Does it work for you?


Posted by Petr on July 21, 2008 at 09:45 AM CEST #

It would be nice to add highlighting whole ()?():() block (I mean the three brackets pairs of the "current" block) like in this example

function fWhatever ($a, $b) {
return ($a > $b)?(($a < $b)?($a-$b):($b-$a)):(($a == 2)?($b):("("$a == $b")"?"("$a")":"("$b|")"));
// | == cursor position, "(" && ")" == highlighted brackets

I tent to use short ifs and it would help a lot in codes that require more complexity. :)

Also higlighting the brackets in a way raymond wrote would add another aspeckt of usefulness ;)
It would be "I always know where I am" - without searching those brackets to place cursor after them and see which one is yellow/(w/e color suits you ;) )

Posted by Azrael Valedhel on July 21, 2008 at 06:39 PM CEST #

Hi Azrael,

I have entered new enhancement against PHP editor.

You can add a comment there, if you want.


Posted by Petr on July 22, 2008 at 05:01 AM CEST #

Thanks Petr, I commented it and issued anothed editor little enhancement - which is highlighting single and double quoted strings with their own colors. It can be found here:

Posted by Azrael Valedhel on July 23, 2008 at 04:58 PM CEST #

It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.

Posted by links of london on October 29, 2009 at 08:21 PM CET #

A four year old little boy was at the doctor's office with his mother in the waiting room when he spotted a pregnant lady on the other side of the room. Having nothing better to do, he walks over to her and inquisitively asks "Why is your stomach so big?"

Posted by Olivea32 on July 07, 2010 at 03:57 AM CEST #

Here's hoping that by posting a new comment with "notify" unchecked, I will stop getting these spam comments as spam email.

Posted by Mark on July 07, 2010 at 09:28 AM CEST #

Attempt #2.

Posted by Mark on July 07, 2010 at 09:29 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blogs is written by NetBeans developers who contribute to the PHP support mainly.


« May 2016