This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 249421 - Add option to colour or highlight method calls or invocations.
Summary: Add option to colour or highlight method calls or invocations.
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
Depends on:
Reported: 2014-12-18 08:06 UTC by negora
Modified: 2014-12-22 09:06 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description negora 2014-12-18 08:06:01 UTC
Recently I've found very useful to highlight with a flashy colour the calls or invocations to methods in Java. So much that this mere fact has completely changed my mind about how to use the syntax highlighting feature (I was over-using it).

I've always tried to avoid nesting more than 2 method calls because it may make that a call to an important method remains "buried" in a mess of code. However, sometimes you have to edit code from other developers and have no time to re-format everything. Or even worse: You are forced to follow that style and not to create "too many" temporary variables. In these cases, highlighting the method calls it's vital. I've done this in Java with some legacy code and it has made my life a lot easier. I can distinguish perfectly where there is each call.

Would it be possible to have this feature in JavaScript too? Thank you!
Comment 1 Petr Pisl 2014-12-18 10:57:59 UTC
Hi, I'm not sure whether I understand. For me what you described, it is highlighting occurrences. And this feature is in javascript as well. I can be wrong. Could you please attach an example?
Comment 2 negora 2014-12-19 10:15:06 UTC
Hello Petr:

I guess that the term "highlighting" may be confusing here, because NetBeans IDE has syntax highlighting (Fonts & Colors → Syntax) and a more general highlighting (Fonts & Colors → Highlighting). So let's refer to the first one as "colouring", if you agree.

I was referring to colouring all method and function calls or invocations, not one in particular or its occurrences. In the colouring section for Java (Fonts & Colors → Syntax → Java) there are the options "Method Declaration" and "Method Use", so you can choose the last one to colour only the calls or invocations.

If this option existed in JavaScript, this piece of code:

  var score = normalizeScore (parseInt (document.getElementById ("score").value, 10));

Would have these words coloured in a different colour:


This option, that sounds trivial, helps a lot not to miss the existence of a method call when there are several ones nested. One can prevent that by "dissecting" the calls, putting one by line. However when you've to read others' code, you can find lots of nested calls that are very complicated to be read :S .

Right now, if I set a colour for the item "Method", it's only the method definition what is coloured:

  function normalizeScore (...) {

The calls to that method get the colour from the item "Identifier".

Thank you!
Comment 3 Petr Pisl 2014-12-22 09:06:11 UTC
Thanks for the explanation. Now it is clear.