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 2022/12/16 06:58:46 UTC

[GitHub] [netbeans] jlahoda commented on a diff in pull request #5013: Make more hints for java available

jlahoda commented on code in PR #5013:
URL: https://github.com/apache/netbeans/pull/5013#discussion_r1050418936


##########
java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/SemanticHighlighterBase.java:
##########
@@ -84,17 +85,83 @@
 import org.netbeans.modules.parsing.spi.SchedulerEvent;
 import org.netbeans.modules.parsing.spi.TaskIndexingMode;
 import org.openide.filesystems.FileUtil;
+import org.openide.util.NbPreferences;
 import org.openide.util.Pair;
+import org.openide.util.WeakListeners;
 
 
 /**
  *
  * @author Jan Lahoda
  */
 public abstract class SemanticHighlighterBase extends JavaParserResultTask {
-    
+
+    public static final String JAVA_INLINE_HINT_PARAMETER_NAME = "javaInlineHintParameterName"; //NOI18N
+    public static final String JAVA_INLINE_HINT_CHAINED_TYPES = "javaInlineHintChainedTypes"; //NOI18N
+    public static final String JAVA_INLINE_HINT_VAR_TYPE = "javaInlineHintVarType"; //NOI18N
+
+    private static final Map<String, Boolean> DEFAULT_VALUES;
+
+    static {
+        Map<String, Boolean> defaultValuesBuilder = new HashMap<>();
+        defaultValuesBuilder.put(JAVA_INLINE_HINT_PARAMETER_NAME, true);
+        defaultValuesBuilder.put(JAVA_INLINE_HINT_CHAINED_TYPES, false);
+        defaultValuesBuilder.put(JAVA_INLINE_HINT_VAR_TYPE, false);
+        DEFAULT_VALUES = Collections.unmodifiableMap(defaultValuesBuilder);
+    }
+
+    private static boolean inited = false;
+    private static Preferences preferences;
+    private static final PreferenceChangeListener preferencesTracker = new PreferenceChangeListener() {

Review Comment:
   Not sure if this listening and updating settings is really needed - it would probably be enough to read the settings at the start of the task. Listening on the change is often only needed to trigger re-run of the tasks when the settings change.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
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