Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry BLIND2019-06-18 15:31:23 -0400
committerThierry BLIND2019-06-18 15:31:23 -0400
commit97167349f48218195da5ce8ef611fd2971ed8cac (patch)
treebfc4ddec92e47be736d32459745ea8f9c176aba5
parent5ddcf895e281670bf90783b82d50fb84dba6c877 (diff)
downloadorg.eclipse.pdt-97167349f48218195da5ce8ef611fd2971ed8cac.tar.gz
org.eclipse.pdt-97167349f48218195da5ce8ef611fd2971ed8cac.tar.xz
org.eclipse.pdt-97167349f48218195da5ce8ef611fd2971ed8cac.zip
No bug - minor code fix
Signed-off-by: Thierry BLIND <thierryblind@msn.com>
-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