From 8d485fb1333973264f49ca5dce465f691c5477a6 Mon Sep 17 00:00:00 2001 From: bananeweizen Date: Sun, 29 Jan 2006 14:25:16 +0000 Subject: [PATCH] bugfix 1412408 https://sourceforge.net/tracker/index.php?func=detail&aid=1412408&group_id=57621&atid=484801 comment folding caused class bodies to be folded --- .../DefaultJavaFoldingStructureProvider.java | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java index 2396518..48be71c 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java @@ -630,6 +630,7 @@ public class DefaultJavaFoldingStructureProvider implements IProjectionListener, return null; List regions = new ArrayList(); + // now add all comments first to the regions list if (fFirstType == null && element instanceof IType) { fFirstType = (IType) element; IRegion headerComment = computeHeaderComment(fFirstType); @@ -641,7 +642,6 @@ 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()); @@ -663,9 +663,9 @@ public class DefaultJavaFoldingStructureProvider implements IProjectionListener, continue; } } - regions.add(new Region(start, shift + range.getLength() - start)); } - + // at the end add the element region + regions.add(new Region(range.getOffset(), range.getLength())); if (regions.size() > 0) { IRegion[] result = new IRegion[regions.size()]; -- 1.7.1