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.
Summary: | Provide a way to have fixable annotation with default action (click on the icon) | ||
---|---|---|---|
Product: | editor | Reporter: | Maria Tishkova <mromashova> |
Component: | Hints & Annotations | Assignee: | apireviews <apireviews> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | issues |
Priority: | P2 | ||
Version: | Dev | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
patch suggested
patch_v2 |
please consider suggested patch 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. Created attachment 164768 [details]
patch_v2
I have change a patch. Removed interface. type are registered in the FixAction when ParserAnnoationType is calculated. Will send request to apireviews@netbeans.org 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. 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? 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) 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) |
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