sdedic commented on code in PR #4448:
URL: https://github.com/apache/netbeans/pull/4448#discussion_r1019221823


##########
java/java.editor.lib/src/org/netbeans/editor/ext/java/JavaFoldManager.java:
##########
@@ -43,6 +43,8 @@ public abstract class JavaFoldManager implements FoldManager {
     public static final FoldType JAVADOC_FOLD_TYPE = 
JavaElementFoldManager.JAVADOC_FOLD_TYPE;
 
     public static final FoldType CODE_BLOCK_FOLD_TYPE = 
JavaElementFoldManager.CODE_BLOCK_FOLD_TYPE;

Review Comment:
   Maybe I did not express the concerns well: The point here is that before the 
change the user of `JavaFoldManager.CODE_BLOCK_FOLD_TYPE` gets a `FoldType` 
instance whose `code() == "method"`. That affects e.g. what setting controls 
the fold type's default expansion state. The user may have 
`fold.method.defaultCollapsed=true` (just example name) in his settings.
   
   Now with this PR mergd, that unchanged fold producing code that link to 
`JavaFoldManager.CODE_BLOCK_FOLD_TYPE` will start to receive a `FoldType` with 
'code() == "code-block"` ... which means the saved settings won't have suddenly 
the same effects.
   
   By changing the (potentially) shared definition of `CODE_BLOCK_FOLD_TYPE`, 
we're breaking settings / semantic compatibility. Yes, it's very frustrating, 
as a constant named CODE_ was misused for actually method level folds...



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

Reply via email to