mbien commented on code in PR #7548:
URL: https://github.com/apache/netbeans/pull/7548#discussion_r1687422296
##########
java/java.hints/src/org/netbeans/modules/java/hints/bugs/Unused.java:
##########
@@ -52,7 +52,12 @@ public class Unused {
@BooleanOption(displayName="#LBL_UnusedPackagePrivate",
tooltip="#TP_UnusedPackagePrivate",
defaultValue=DETECT_UNUSED_PACKAGE_PRIVATE_DEFAULT)
public static final String DETECT_UNUSED_PACKAGE_PRIVATE =
"detect.unused.package.private";
- @TriggerTreeKind(Kind.COMPILATION_UNIT)
+ @TriggerTreeKind({
+ //class-like kinds:
+ Kind.ANNOTATION_TYPE, Kind.CLASS, Kind.ENUM, Kind.INTERFACE,
Kind.RECORD,
+ Kind.VARIABLE,
+ Kind.METHOD
+ })
public static List<ErrorDescription> unused(HintContext ctx) {
Review Comment:
ah got it, the annotation has to anchor on the trigger. I didn't expect that
this would matter - makes sense though.
A bit of a shame that this makes the not-unused case so much slower.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists