Skip to content Skip to sidebar Skip to footer

In Android Studio 1.1.0, Is There A Way To Change The Color Of Only Those Method Names Defined In The Current File/class?

I can imagine that this might not (ever) be a feature. (I wouldn't necessarily want 'other' method calls to be blue as shown in the second block; blue is just to emphasize what's

Solution 1:

No, there is no such feature in IntelliJ IDEA as of version 14.1. It can be implemented as a plugin, but I'm not aware of any such plugin.

Solution 2:

Just documenting, as I was looking for a way to do this and I have found a way that is satisfactory enough to me.

There's a way, but it's a workaround, it will have side effects.

intellij windows

How:

  • Go to File > Settings > Inspections (Choose the Global Profile if necessary).

  • Type in the search: qualified.

  • Tick the checkbox next to "Instance method call not qualified with 'this'".

  • Click on Severity > Edit severities, add new entry by clicking the green + button.

    • Name it whatever you want.

    • You must put it at the bottom of the list using the arrows. If you don't, the F2 key will no longer work as you expect it as it will prioritize errors at the top of the list.

    • Set the Error stripe mark to #FFFFFF, or the same color as the scrollbar.

    • Set it bold if you wish.

    • If you want to set a color, you must set a background color to white (or black if you have a black interface). If you don't, the color will appear black in most conditions.

  • If you really want to, do the same for "Unnecessary 'this' qualifier"; there is an additional checkbox to make it only apply to methods and not fields.

Side effects:

  • This enables inspections, which is not desired.

  • Pointing the mouse cursor onto the method calls will cause a hover text to appear describing the inspection.

  • If your code has no errors, no warnings, and no additional informative inspections, pressing F2 will jump through these calls.

Post a Comment for "In Android Studio 1.1.0, Is There A Way To Change The Color Of Only Those Method Names Defined In The Current File/class?"