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


##########
java/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java:
##########
@@ -76,7 +76,11 @@ public class JavaElementFoldManager implements FoldManager {
             new org.netbeans.api.editor.fold.FoldTemplate(3, 2, "/**...*/")); 
// NOI18N
 
     @NbBundle.Messages("FoldType_Methods=Methods")
-    public static final FoldType CODE_BLOCK_FOLD_TYPE = 
FoldType.MEMBER.derive("method", Bundle.FoldType_Methods(), 
+    public static final FoldType METHOD_BLOCK_FOLD_TYPE = 
FoldType.MEMBER.derive("method", Bundle.FoldType_Methods(), 
+            new org.netbeans.api.editor.fold.FoldTemplate(1, 1, "{...}")); // 
NOI18N
+
+    @NbBundle.Messages("FoldType_CodeBlocks=Code Blocks")

Review Comment:
   Please also change the reference in `java.editor.lib` - class 
`org.netbeans.editor.ext.java.JavaFoldManager`. This is a deprecated support 
for ancient modules that reference symbolically `CODE_BLOCK_FOLD_TYPE` (uses 
implementation dependency on `java.editor`) - otherwise the old modules would 
change their folding semantics.



##########
java/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java:
##########
@@ -273,6 +277,11 @@ public FoldInfo createInnerClassFold(int start, int end) {
                     return FoldInfo.range(start, end, INNERCLASS_TYPE);
                 }
 
+                @Override
+                public FoldInfo createMethodsFold(int start, int end) {

Review Comment:
   I know that it may be awkward - given the 'createCodeBlockFold` really does 
not describe 'method-level' folds well (although it has been its purpose) -- 
but since there are known implementation dependencies, maybe the `Creator`'s 
method could rremain as it is - and the **real** code blocks could get a new 
name ?
   
   cc @dbalek -- what's your opinion ? Impl dependencies usually do not deserve 
any compatibility attention (especially if this PR refactors all known ones in 
the codebase), but still - this support incl. the misnamed code block (both 
constant and the Creator method) is used for long time by plugins.



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