aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzhongwei2013-03-17 09:57:16 (EDT)
committerzzhongwei2013-03-17 09:57:16 (EDT)
commit19ff25664fd926c6afc5ae812a5d0814666e202c (patch)
tree903de54628a3c297b06999429598b7e4f61fb8d9
parent0fde69aefdb7910253830e9655bac5af4ba4f1f2 (diff)
downloadorg.eclipse.pdt-19ff25664fd926c6afc5ae812a5d0814666e202c.zip
org.eclipse.pdt-19ff25664fd926c6afc5ae812a5d0814666e202c.tar.gz
org.eclipse.pdt-19ff25664fd926c6afc5ae812a5d0814666e202c.tar.bz2
403562: [forums] last char is missing for array key replace
https://bugs.eclipse.org/bugs/show_bug.cgi?id=403562
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/contexts/ArrayKeyContext.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/contexts/ArrayKeyContext.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/contexts/ArrayKeyContext.java
index 6886e2a..b981aad 100644
--- a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/contexts/ArrayKeyContext.java
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/contexts/ArrayKeyContext.java
@@ -87,6 +87,14 @@ public class ArrayKeyContext extends AbstractCompletionContext {
}
endPosition = PHPTextSequenceUtilities.readBackwardSpaces(
statementText, startPosition);
+ if (endPosition > 0
+ && (statementText.charAt(endPosition - 1) == '\"' || statementText
+ .charAt(endPosition - 1) == '\'')) {
+ hasQuotes = true;
+ startPosition = endPosition - 1;
+ endPosition = PHPTextSequenceUtilities.readBackwardSpaces(
+ statementText, startPosition);
+ }
if (endPosition == 0
|| statementText.charAt(endPosition - 1) != '[') {
return false;