X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/actions/AddBlockCommentAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/actions/AddBlockCommentAction.java index b5d959a..28fc336 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/actions/AddBlockCommentAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/actions/AddBlockCommentAction.java @@ -53,8 +53,9 @@ public class AddBlockCommentAction extends BlockCommentAction { int selectionOffset= selection.getOffset(); int selectionEndOffset= selectionOffset + selection.getLength(); List edits= new LinkedList(); - ITypedRegion partition= docExtension.getPartition(IPHPPartitions.PHP_PARTITIONING, selectionOffset); - + //ITypedRegion partition= docExtension.getPartition(IPHPPartitions.PHP_PARTITIONING, selectionOffset, false); + ITypedRegion partition= docExtension.getPartition(IDocumentExtension3.DEFAULT_PARTITIONING, selectionOffset, false); + handleFirstPartition(partition, edits, factory, selectionOffset); while (partition.getOffset() + partition.getLength() < selectionEndOffset) { @@ -82,7 +83,8 @@ public class AddBlockCommentAction extends BlockCommentAction { Assert.isTrue(partOffset <= offset, "illegal partition"); //$NON-NLS-1$ // first partition: mark start of comment - if (partType == IDocument.DEFAULT_CONTENT_TYPE) { +// if (partType == IDocument.DEFAULT_CONTENT_TYPE) + if (partType == IPHPPartitions.PHP_PARTITIONING) { // Java code: right where selection starts edits.add(factory.createEdit(offset, 0, getCommentStart())); } else if (isSpecialPartition(partType)) { @@ -112,7 +114,7 @@ public class AddBlockCommentAction extends BlockCommentAction { boolean wasJavadoc= false; // true if the previous partition is javadoc - if (partType == IPHPPartitions.PHP_MULTILINE_COMMENT) { + if (partType == IPHPPartitions.PHP_PHPDOC_COMMENT) { wasJavadoc= true; @@ -124,7 +126,7 @@ public class AddBlockCommentAction extends BlockCommentAction { } // advance to next partition - partition= docExtension.getPartition(IPHPPartitions.PHP_PARTITIONING, partEndOffset); + partition= docExtension.getPartition(IPHPPartitions.PHP_PARTITIONING, partEndOffset, false); partType= partition.getType(); // start of next partition @@ -138,7 +140,7 @@ public class AddBlockCommentAction extends BlockCommentAction { } else { // !wasJavadoc - if (partType == IPHPPartitions.PHP_MULTILINE_COMMENT) { + if (partType == IPHPPartitions.PHP_PHPDOC_COMMENT) { // if next is javadoc, end block comment before edits.add(factory.createEdit(partition.getOffset(), 0, getCommentEnd())); // } else if (partType == IJavaPartitions.JAVA_MULTI_LINE_COMMENT) { @@ -162,7 +164,8 @@ public class AddBlockCommentAction extends BlockCommentAction { String partType= partition.getType(); - if (partType == IDocument.DEFAULT_CONTENT_TYPE) { +// if (partType == IDocument.DEFAULT_CONTENT_TYPE) { + if (partType == IPHPPartitions.PHP_PARTITIONING) { // normal java: end comment where selection ends edits.add(factory.createEdit(endOffset, 0, getCommentEnd())); } else if (isSpecialPartition(partType)) { @@ -182,7 +185,7 @@ public class AddBlockCommentAction extends BlockCommentAction { private boolean isSpecialPartition(String partType) { return// partType == IPHPPartitions.PHP_CHARACTER //|| - partType == IPHPPartitions.PHP_STRING; + partType == IPHPPartitions.PHP_STRING_DQ; //|| partType == IPHPPartitions.PHP_SINGLE_LINE_COMMENT; }