Improved support for comment folding
authoraxelcl <axelcl>
Wed, 26 Oct 2005 22:02:29 +0000 (22:02 +0000)
committeraxelcl <axelcl>
Wed, 26 Oct 2005 22:02:29 +0000 (22:02 +0000)
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java

index 77a19ac..2396518 100644 (file)
@@ -641,6 +641,7 @@ public class DefaultJavaFoldingStructureProvider implements IProjectionListener,
 
                                final int shift = range.getOffset();
                                int start = shift;
+                               regions.add(new Region(range.getOffset(), range.getLength()));
                                if (element instanceof IType) {
                                        Scanner scanner = ToolFactory.createScanner(true, false, false, false);
                                        scanner.setSource(contents.toCharArray());
@@ -662,8 +663,9 @@ public class DefaultJavaFoldingStructureProvider implements IProjectionListener,
                                                        continue;
                                                }
                                        }
+                                       regions.add(new Region(start, shift + range.getLength() - start));
                                }
-                               regions.add(new Region(start, shift + range.getLength() - start));
+
 
                                if (regions.size() > 0) {
                                        IRegion[] result = new IRegion[regions.size()];