You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/03/26 06:33:06 UTC

[GitHub] jlahoda commented on issue #463: netbeans-479: Added ConvertToVarHint to replace explicit type with var

jlahoda commented on issue #463: netbeans-479: Added ConvertToVarHint to replace explicit type with var
URL: https://github.com/apache/incubator-netbeans/pull/463#issuecomment-376060393
 
 
   Hi,
   
   Sorry for delay. Some initial comments:
   -please note that every occurrence of @Hint means a separate "hint" and a separate entry in Tools/Options/Editor/Hints. I think there should only be a single @Hint for this (on the class), which means a single hint/single configuration entry, and then there can be any number of @Trigger methods inside the class that will all work for that single hint. Some conversion may be seen undesirable (worsening readability), so it might be desirable to allow disabling the conversion in some contexts, although I am not sure offhand for which it should be. Defining simple boolean options should be simple, see @BooleanOption, e.g. in: java.hints/src/org/netbeans/modules/java/hints/perf/SizeEqualsZero.java
   -please note that @Hint has minSourceVersion that can be used to specify minimal -source version for the hint. But even if that didn't work in a particular case, there is CompilationInfo.getSourceVersion(), which should be used instead of SourceLevelQuery in hints.
   -category = "suggestions" -> category = "rules15" (the category name is confusing, but it is not easy to change; this will be under "JDK Migration Support")
   -I wonder if the hint shouldn't have simply @TriggerTreeKind(VARIABLE) or @TriggerPattern("$mods$ $type $var =new $init;") and then internally trying to figure out if the variable can be var or not. (Also please note there will soon be an API method to check if a variable is "var" or not that the hint will be able to use.)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists