aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzhongwei2013-03-19 04:26:28 (EDT)
committerzzhongwei2013-03-19 04:26:28 (EDT)
commitf356ca0fa2f75f969bbab80bf0f4ef210f36479f (patch)
tree91a919667dc6557be2054c386b597f07cd5162f0
parentc115a319ba12370480116c8b09844fb45617fa27 (diff)
downloadorg.eclipse.pdt-f356ca0fa2f75f969bbab80bf0f4ef210f36479f.zip
org.eclipse.pdt-f356ca0fa2f75f969bbab80bf0f4ef210f36479f.tar.gz
org.eclipse.pdt-f356ca0fa2f75f969bbab80bf0f4ef210f36479f.tar.bz2
403720: [Internal]CA add ' before and after class full name
https://bugs.eclipse.org/bugs/show_bug.cgi?id=403720
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/ProposalExtraInfo.java13
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/contentassist/PHPCompletionProposalCollector.java16
2 files changed, 27 insertions, 2 deletions
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/ProposalExtraInfo.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/ProposalExtraInfo.java
index 405494a..7934601 100644
--- a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/ProposalExtraInfo.java
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/ProposalExtraInfo.java
@@ -11,6 +11,7 @@ public final class ProposalExtraInfo {
public static final int METHOD_ONLY = 1 << 5;
public static final int NO_INSERT_NAMESPACE = 1 << 6;
public static final int CLASS_IN_NAMESPACE = 1 << 7;
+ public static final int ADD_QUOTES = 1 << 8;
public static boolean isTypeOnly(int flags) {
return (flags & TYPE_ONLY) != 0;
@@ -84,4 +85,16 @@ public final class ProposalExtraInfo {
}
}
+ public static boolean isAddQuote(Object flags) {
+ if (flags instanceof Integer) {
+ return contain(((Integer) flags).intValue(), ADD_QUOTES);
+ } else {
+ return false;
+ }
+ }
+
+ public static boolean contain(int flags, int flag) {
+ return (flags & flag) != 0;
+ }
+
}
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/contentassist/PHPCompletionProposalCollector.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/contentassist/PHPCompletionProposalCollector.java
index 9109d2a..2186a7d 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/contentassist/PHPCompletionProposalCollector.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/contentassist/PHPCompletionProposalCollector.java
@@ -226,8 +226,14 @@ public class PHPCompletionProposalCollector extends
private boolean fReplacementStringComputed = false;
public String getReplacementString() {
- if (!fReplacementStringComputed)
- setReplacementString(computeReplacementString());
+ if (!fReplacementStringComputed) {
+ String replacementString = computeReplacementString();
+ if (ProposalExtraInfo.isAddQuote(typeProposal
+ .getExtraInfo())) {
+ replacementString = "'" + replacementString + "'";
+ }
+ setReplacementString(replacementString);
+ }
return super.getReplacementString();
}
@@ -238,6 +244,12 @@ public class PHPCompletionProposalCollector extends
if (ProposalExtraInfo.isClassInNamespace(typeProposal
.getExtraInfo())) {
return PHPModelUtils.getFullName(type);
+ // String result = PHPModelUtils.getFullName(type);
+ // if (ProposalExtraInfo.isAddQuote(typeProposal
+ // .getExtraInfo())) {
+ // result = "'" + result + "'";
+ // }
+ // return result;
}
String prefix = "";