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 250792 - custom hint configure or disable problems
Summary: custom hint configure or disable problems
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-28 22:51 UTC by err
Modified: 2016-08-05 09:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description err 2015-02-28 22:51:40 UTC
After defining a custom hint and doing "inspect and transform" as needed; I get the hint lightbulb from the editor with
        Configure "xxx" hint >
and after right arrow there is
        Disable "xxx" hint
        Configure "xxx" hint
        Run Inspect on ...
        Run Inspect&Transform on ...

Selecting Configure brings up the editor options hint dialog, but the hint is not there and can not be configured.

I can disable the hint and after changing focus and back again the hint bulb
goes away.

Big problem is that I see no way to re-enable it.

How do I re-enable the hint in the editor?

How do I configure the hint, warning/error/on-line-only?
Comment 1 err 2015-03-18 01:49:49 UTC
Up the prio since there is no way to re-enable the hint.
Comment 2 Svata Dedic 2015-03-25 15:59:06 UTC
Not a P2 defect; the hint is still usable at least in I&T where it was defined.

Well. I've found commit #916ebfd4514a from 8/2011 which explicitly disables custom hints in the editor configuration - while the hints show up and evaluate, this seems somewhat inconsistent.

After consulting the original Hints author I decided to enable custom hints configuration for the editor again - in a hope I don't introduce some e.g. performance problem.

There are still some inconsistency, like the custom hint can be ONLY defined in Inspect & Transform, while it is used elsewhere (editor, inspect); this should be eventually solved as a lower priority task

Fixed in jet-main#596a0e8e6c46
Comment 3 err 2015-03-25 19:24:11 UTC
> while the hints show up and *evaluate*

Hm, that would seem to be a source of potential performance issues. In any event hope the configuration can stay in there. 

I wonder if an eventual solution might have a "make available to rest of system" button from the I&T area? Possibly a simple way, but that's for another day and not for me...
Comment 4 Quality Engineering 2015-03-27 03:24:07 UTC
Integrated into 'main-silver', will be available in build *201503270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/596a0e8e6c46
User: Svata Dedic <sdedic@netbeans.org>
Log: #250792: reverting 916ebfd4514a - custom hint configuration enabled in the editor
Comment 5 err 2015-04-01 14:45:58 UTC
With the change, the custom hint now appears in the configure hints dialog. A few of the related features work.

But, changing the hint to "Warning on current line" does not work. When the caret is on the line, <alt-enter> does not show the hint in the list.

Using
    package debug;

    import java.util.List;
    import java.util.LinkedList;

    public class NewClass {
        void foo() {
            List<String> linkedList = new LinkedList<>();

            List linkedList2 = new LinkedList();
        }
    }
and
    $ cat /errw/AppData/Roaming/NetBeans/dev/config/rules/LinkedListToArray.hint
    <!description="change LinkedList to ArrayList">

       new java.util.LinkedList<$any$>()
    => new java.util.ArrayList<$any$>()
    ;;

       new java.util.LinkedList()
    => new java.util.ArrayList()
    ;;



Product Version: NetBeans IDE Dev (Build 20150401-09512dd8aa7b)
Java: 1.8.0_40; Java HotSpot(TM) 64-Bit Server VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b26
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 6 Svata Dedic 2016-08-05 09:40:19 UTC
You need to position a care on exactly the construct which triggers the hint. So if you place caret inside the 'new LinkedList' expression, you'll get the hint if set as "warning on current line".triggered by