Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/ast/rewrite/ASTRewriteAnalyzer.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/ast/rewrite/ASTRewriteAnalyzer.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/ast/rewrite/ASTRewriteAnalyzer.java
index 5e75c0e15..aa639d62c 100644
--- a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/ast/rewrite/ASTRewriteAnalyzer.java
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/ast/rewrite/ASTRewriteAnalyzer.java
@@ -3724,7 +3724,13 @@ public final class ASTRewriteAnalyzer extends AbstractVisitor {
insertString = "const "; //$NON-NLS-1$
}
- int start = useStatement.getStart() + 4; // move after 'use '
+ // move after 'use '
+ int start = useStatement.getStart() + 3;
+ if (content.length > start && content[start] == ' ') {
+ start++;
+ } else {
+ insertString = " " + insertString; //$NON-NLS-1$
+ }
int length = 0;
if (!useStatement.parts().isEmpty() && useStatement.getNamespace() == null) {
length = useStatement.parts().get(0).getStart() - start;

Back to the top