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 271069 - Provide a way to have fixable annotation with default action (click on the icon)
Summary: Provide a way to have fixable annotation with default action (click on the icon)
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: Dev
Hardware: PC Linux
: P2 normal (vote)
Assignee: apireviews
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-11 10:25 UTC by Maria Tishkova
Modified: 2017-07-25 02:20 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
patch suggested (10.76 KB, patch)
2017-07-11 10:25 UTC, Maria Tishkova
Details | Diff
patch_v2 (5.67 KB, patch)
2017-07-14 08:18 UTC, Maria Tishkova
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maria Tishkova 2017-07-11 10:25:36 UTC
Created attachment 164738 [details]
patch suggested

Now Editor Hints support custom type that allows to use own icon for errors/warnings but there is no any way to make fixable annotation icon clickable as all FixAction supported types are hard-coded.

I suggest to apply patch attached to enable fixable annotation default action support. We do need this for our new feature C/C++ Clank Diagnostics

spec version incrementation is not included in the patch
Comment 1 Maria Tishkova 2017-07-11 10:27:58 UTC
please consider suggested patch
Comment 2 Jan Lahoda 2017-07-12 18:48:03 UTC
I guess one way forward would be to prepare a patch, send it to the API review and when the review is over (i.e. there are no objections, or are resolved), simply push.

On the code level, looking at the patch, I wonder: is it necessary to create a new interface for this? Could the custom annotation types be automatically added to the list if some fixes are available (presumably if LazyFixList.probablyContainsFixes() == true)? One way to do that would be to have a registry of annotation types with fixes, override getValue in FixAction and return the value from the registry on every query.
Comment 3 Maria Tishkova 2017-07-14 08:18:45 UTC
Created attachment 164768 [details]
patch_v2
Comment 4 Maria Tishkova 2017-07-14 08:19:10 UTC
I have change a patch. Removed interface. type are registered in the FixAction when ParserAnnoationType is calculated. Will send request to apireviews@netbeans.org
Comment 5 Jan Lahoda 2017-07-17 13:15:03 UTC
Just a few minor nits:
JL01: delete "//To change body of generated methods, choose Tools | Templates."
JL02: "//dynamicly change the regiister of fixable annotations Fix action (click on the icon) will work for." should probably be something like "//dynamically register this annotation type as fixable, so Fix action (click on the icon) will work for it"
JL03: would it be possible to add this to the apichanges? Even if this is not a signature change, it is an API change.

I'd also suggest to add a test, even though I see there are no directly related tests, so this may be too much of a burden.
Comment 6 Maria Tishkova 2017-07-18 12:12:38 UTC
Thanks for the comments

(In reply to Jan Lahoda from comment #5)
> Just a few minor nits:
> JL01: delete "//To change body of generated methods, choose Tools |
> Templates."
fixed
> JL02: "//dynamicly change the regiister of fixable annotations Fix action
> (click on the icon) will work for." should probably be something like
> "//dynamically register this annotation type as fixable, so Fix action
> (click on the icon) will work for it"
fixed
> JL03: would it be possible to add this to the apichanges? Even if this is
> not a signature change, it is an API change.
fixed
> 
> I'd also suggest to add a test, even though I see there are no directly
> related tests, so this may be too much of a burden.
The changes will influence only the annotations of customType. We can ask our QA to fix this feature with C/C++ functional tests

Can I make a push?
Comment 7 Maria Tishkova 2017-07-24 07:55:08 UTC
fixed in cnd-main

changeset:   304368:c07b9272174d
user:        Maria Dalmatova <mromashova@netbeans.org>
date:        Mon Jul 24 10:52:27 2017 +0300
summary:     fixed bz#271069 - Provide a way to have fixable annotation with default action (click on the icon)
Comment 8 Quality Engineering 2017-07-25 02:20:45 UTC
Integrated into 'main-silver', will be available in build *201707250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c07b9272174d
User: Maria Dalmatova <mromashova@netbeans.org>
Log: fixed bz#271069 - Provide a way to have fixable annotation with default action (click on the icon)