Highlight Method/Function body with custom color.

Its difficult for me to see structure of a class (even with code indented and spaced) when i have tiny methods and long methods it all looks like big chunk of code that i have to spend time to look trough to find my method.

What i want is to have entire method body from declaration to closing bracket highlighted in editor with custom background color.

Right now i only see parts of method highlighted, but i want entire method to have background that stands out.

Perhaps same could be done for properties.

4

Hi there,

There is no such functionality currently available.

But this IDE has "method separators" -- horizontal line that is drawn before each method/function/class. You can make that line more visible to easily spot the method "borders"

  • "Settings/Preferences | Editor | General | Appearance --> Show method separators" to enable them (should be ON by default)
  • "Settings/Preferences | Editor | Color Scheme | General | Code --> Method separator color" to change the line color.

Feel free to submit Feature Request ticket at Issue Tracker .. and one day it may be implemented (but I would not place much hope for a fast implementation of such ticket TBH)

 

P.S. If you would use PHPDoc comments for your code (functions/methods) it would add yet another "visual marker" -- it usually has different (more fade) colour that helps noticing where the method starts.

1

Method separators do work good.

What would be even better if as you have ability to set default color for each function also change colors of ones you like with comments.

There's way to set colors for folders and files in project view (on the left) if i remember correctly it helps keep organized if you work with a team like red don't touch or whatever, if you could do similar thing with code fragments in editor its even better for team work and organization.

Say some magic comment within a function or any bracketed block { ... } will color that block certain background color.

function sayHello ($name) { #theme:skyblue

   echo "Hello " . $name;

}

function openLog($file) { #color:#ff00aa

$myfile = fopen("webdictionary.txt", "r") or die("Unable to open file!");
echo fread($myfile,filesize("webdictionary.txt"));
fclose($myfile);

}

One could label functions that do work with files one color, functions that work with database another color, template function another etc.

If not too difficult please create feature request for me.

0

You can set background colour for files in Project View panel (by creating custom scopes and assigning different colors to them; will also be used in other places, like editor tab itself, popups that show files etc):

>to highlight this particular block certain color this way you can label functions that say do work with files one color, functions that work with database another color etc.

Very easy -- refactor your code a bit by moving them into separate files... so file "FileUtils.php" will only contain stuff that works with files and "DatabaseUtils.php" those that work with DB.

2
> Very easy -- refactor your code a bit by moving them into separate
> files... so file "FileUtils.php" will only contain stuff that works
> with files and "DatabaseUtils.php" those that work with DB.

This is what i am trying to avoid currently because breaking classes has its downsides too.

Would be great if you guys cold develop this option so people have an alternative.

Currently i found following feature Custom code folding regions it should not be too much hassle to extend it a little adding color code #5CAF87 to comment and have background change to color you like.

 

//<editor-fold desc="Show Message" color="#5CAF87">
private function doSomething() {

echo "Hello World!";

}
//</editor-fold>
0

@Ivan

You are free to submit Feature Request ticket to the Issue Tracker - anyone interested can report bug or request new features (that's why Issue Tracker is publicly available).

Based on my experience (and my understand thing the reasons behind your case) I may say that this one is unlikely to be implemented any time soon .. as it's quite specific to your workflow.

I'm not sure that adding "IDE -- use this color to highlight the next code block" comments in the actual code is what majority of people would normally want to do.

0

To me its evolution of "Semantic Highlighting" feature, except its highlight code blocks within a file.

 

Another idea is to just add color code to any code block that has curly brackets, and regardless of where it is all code will change background color.

$n = 1

function soStuff( $var ) { //#AA00F0
   ...
   for ($n = 0; $n <= 0; $n++) {
      ...
   //#00AAFF
   }
   ...
}
0

请先登录再写评论。