Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferguson2007-02-26 09:06:51 +0000
committerAndrew Ferguson2007-02-26 09:06:51 +0000
commitb2b1287072f451983e75f2b6d6b3e0cdf008f261 (patch)
tree6e0a722884c340d9351a7f16ff16ac2926a42c28
parent58342e9fad56c63335a1afe1e145a0c113d2c4c4 (diff)
downloadorg.eclipse.cdt-b2b1287072f451983e75f2b6d6b3e0cdf008f261.tar.gz
org.eclipse.cdt-b2b1287072f451983e75f2b6d6b3e0cdf008f261.tar.xz
org.eclipse.cdt-b2b1287072f451983e75f2b6d6b3e0cdf008f261.zip
109724: apply patch for Bryan Wilkinson
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCStructure.java32
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java58
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FunctionReference_Prefix.java6
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_Prefix.java1
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_Prefix.java1
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Prefix2.java6
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionProposalComputer.java4
14 files changed, 23 insertions, 105 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java
index ede1a5f56f8..06547624ab3 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java
@@ -616,7 +616,7 @@ public class CVisitor {
char [] p = fieldReference.getFieldName().toCharArray();
IField [] fields = ((ICompositeType) type).getFields();
for ( int i = 0; i < fields.length; i++ ) {
- if( CharArrayUtils.equals( fields[i].getNameCharArray(), 0, p.length, p, false ) ){
+ if( CharArrayUtils.equals( fields[i].getNameCharArray(), 0, p.length, p, true ) ){
result = (IBinding[]) ArrayUtil.append( IBinding.class, result, fields[i] );
}
}
@@ -1446,7 +1446,7 @@ public class CVisitor {
char [] c = candidate.toCharArray();
if( prefixMap == null && CharArrayUtils.equals( c, name ) ){
return candidate;
- } else if( prefixMap != null && CharArrayUtils.equals( c, 0, name.length, name, false ) && !prefixMap.containsKey( c ) ){
+ } else if( prefixMap != null && CharArrayUtils.equals( c, 0, name.length, name, true ) && !prefixMap.containsKey( c ) ){
prefixMap.put( c, candidate );
}
return prefixMap;
@@ -1468,7 +1468,7 @@ public class CVisitor {
char [] n = name.toCharArray();
if( prefixMap == null && CharArrayUtils.equals( c, n ) )
return tempName;
- else if( prefixMap != null && CharArrayUtils.equals( c, 0, n.length, n, false ) && !prefixMap.containsKey( c ) )
+ else if( prefixMap != null && CharArrayUtils.equals( c, 0, n.length, n, true ) && !prefixMap.containsKey( c ) )
prefixMap.put( c, tempName );
} else {
return checkForBinding( scope, paramDecl.getDeclSpecifier(), name, typesOnly, prefixMap );
@@ -1994,7 +1994,7 @@ public class CVisitor {
ILabel label = labels[i];
if (prefixLookup) {
if (CharArrayUtils.equals(label.getNameCharArray(),
- 0, n.length, n, false)) {
+ 0, n.length, n, true)) {
b3.add(label);
}
} else {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java
index 38caf055804..d24556a7626 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java
@@ -369,7 +369,7 @@ public class CPPASTQualifiedName extends CPPASTNode implements
private boolean nameMatches(char[] potential, char[] name, boolean isPrefix) {
if (isPrefix) {
- return CharArrayUtils.equals(potential, 0, name.length, name, false);
+ return CharArrayUtils.equals(potential, 0, name.length, name, true);
} else {
return CharArrayUtils.equals(potential, name);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
index 43dbccbdef0..a2227b0a0df 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
@@ -319,7 +319,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
IBinding[] results = null;
results = (IBinding[]) ArrayUtil.addAll( IBinding.class, results, super.find( name, prefixLookup ));
- if((prefixLookup && CharArrayUtils.equals(compName.toCharArray(), 0, n.length, n, false))
+ if((prefixLookup && CharArrayUtils.equals(compName.toCharArray(), 0, n.length, n, true))
|| (!prefixLookup && CharArrayUtils.equals(compName.toCharArray(), n))) {
results = (IBinding[]) ArrayUtil.addAll( IBinding.class, results, getConstructors( bindings, true ) );
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java
index ded642c9b83..59c15a55ccf 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java
@@ -89,7 +89,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
for (int i = 0; i < labels.size(); i++) {
char[] key = labels.keyAt(i);
- if ((prefixLookup && CharArrayUtils.equals(key, 0, n.length, n, false))
+ if ((prefixLookup && CharArrayUtils.equals(key, 0, n.length, n, true))
|| (!prefixLookup && CharArrayUtils.equals(key, n))) {
bindings.add(labels.get(key));
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java
index a0f730934c6..f88932e2888 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java
@@ -1844,7 +1844,7 @@ public class CPPSemantics {
}
char[] c = potential.toCharArray();
char [] n = data.name();
- return (data.prefixLookup && CharArrayUtils.equals(c, 0, n.length, n, false))
+ return (data.prefixLookup && CharArrayUtils.equals(c, 0, n.length, n, true))
|| (!data.prefixLookup && CharArrayUtils.equals(c, n));
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCStructure.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCStructure.java
index e55468d5a08..414ec72fef1 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCStructure.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCStructure.java
@@ -29,15 +29,14 @@ import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.c.ICCompositeTypeScope;
import org.eclipse.cdt.core.index.IIndexBinding;
-import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.index.IIndexScope;
import org.eclipse.cdt.internal.core.index.IIndexType;
import org.eclipse.cdt.internal.core.pdom.PDOM;
import org.eclipse.cdt.internal.core.pdom.db.PDOMNodeLinkedList;
+import org.eclipse.cdt.internal.core.pdom.dom.BindingCollector;
import org.eclipse.cdt.internal.core.pdom.dom.IPDOMMemberOwner;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
-import org.eclipse.cdt.internal.core.pdom.dom.PDOMNamedNode;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNotImplementedError;
import org.eclipse.core.runtime.CoreException;
@@ -204,40 +203,13 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
fail(); return null;
}
- private static class BindingFinder implements IPDOMVisitor {
- private List fBindings = new ArrayList();
- private char[] fName;
- private boolean fPrefixLookup;
-
- public BindingFinder(char[] name, boolean prefiexLookup) {
- fName= name;
- fPrefixLookup= prefiexLookup;
- }
-
- public boolean visit(IPDOMNode node) throws CoreException {
- if (node instanceof PDOMNamedNode && node instanceof IBinding) {
- char[] n= ((PDOMNamedNode) node).getDBName().getChars();
- if ((fPrefixLookup && CharArrayUtils.equals(n, 0, fName.length, fName, false))
- || (!fPrefixLookup && CharArrayUtils.equals(n, fName))) {
- fBindings.add(node);
- }
- }
- return false;
- }
- public void leave(IPDOMNode node) throws CoreException {
- }
- public IBinding[] getBindings() {
- return (IBinding[])fBindings.toArray(new IBinding[fBindings.size()]);
- }
- }
-
public IBinding[] find(String name) throws DOMException {
return find(name, false);
}
public IBinding[] find(String name, boolean prefixLookup) throws DOMException {
try {
- BindingFinder visitor= new BindingFinder(name.toCharArray(), prefixLookup);
+ BindingCollector visitor = new BindingCollector(getLinkageImpl(), name.toCharArray(), null, prefixLookup, !prefixLookup);
accept(visitor);
return visitor.getBindings();
} catch (CoreException e) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java
index 0b81cd199ff..b60912c5f2f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java
@@ -37,7 +37,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.core.index.IIndexBinding;
-import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassScope;
@@ -46,10 +45,10 @@ import org.eclipse.cdt.internal.core.index.IIndexScope;
import org.eclipse.cdt.internal.core.index.IIndexType;
import org.eclipse.cdt.internal.core.pdom.PDOM;
import org.eclipse.cdt.internal.core.pdom.db.PDOMNodeLinkedList;
+import org.eclipse.cdt.internal.core.pdom.dom.BindingCollector;
import org.eclipse.cdt.internal.core.pdom.dom.IPDOMMemberOwner;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMName;
-import org.eclipse.cdt.internal.core.pdom.dom.PDOMNamedNode;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
import org.eclipse.core.runtime.CoreException;
@@ -366,30 +365,6 @@ ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope {
return true;
}
- private static class BindingCollector implements IPDOMVisitor {
- private List fBindings = new ArrayList();
- private char[] fName;
-
- public BindingCollector(char[] name) {
- fName= name;
- }
-
- public boolean visit(IPDOMNode node) throws CoreException {
- if (node instanceof PDOMNamedNode && node instanceof IBinding) {
- PDOMNamedNode nn= (PDOMNamedNode) node;
- if (nn.getDBName().equals(fName)) {
- fBindings.add(node);
- }
- }
- return false;
- }
- public void leave(IPDOMNode node) throws CoreException {
- }
- public IBinding[] getBindings() {
- return (IBinding[])fBindings.toArray(new IBinding[fBindings.size()]);
- }
- }
-
public IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
try {
if (getDBName().equals(name.toCharArray())) {
@@ -400,7 +375,7 @@ ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope {
return this;
}
- BindingCollector visitor= new BindingCollector(name.toCharArray());
+ BindingCollector visitor = new BindingCollector(getLinkageImpl(), name.toCharArray());
accept(visitor);
return CPPSemantics.resolveAmbiguities(name, visitor.getBindings());
} catch (CoreException e) {
@@ -408,33 +383,6 @@ ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope {
}
return null;
}
-
- private static class BindingFinder implements IPDOMVisitor {
- private List fBindings = new ArrayList();
- private char[] fName;
- private boolean fPrefixLookup;
-
- public BindingFinder(char[] name, boolean prefiexLookup) {
- fName= name;
- fPrefixLookup= prefiexLookup;
- }
-
- public boolean visit(IPDOMNode node) throws CoreException {
- if (node instanceof PDOMNamedNode && node instanceof IBinding) {
- char[] n= ((PDOMNamedNode) node).getDBName().getChars();
- if ((fPrefixLookup && CharArrayUtils.equals(n, 0, fName.length, fName, false))
- || (!fPrefixLookup && CharArrayUtils.equals(n, fName))) {
- fBindings.add(node);
- }
- }
- return false;
- }
- public void leave(IPDOMNode node) throws CoreException {
- }
- public IBinding[] getBindings() {
- return (IBinding[])fBindings.toArray(new IBinding[fBindings.size()]);
- }
- }
public IBinding[] find(String name) throws DOMException {
return find(name, false);
@@ -442,7 +390,7 @@ ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope {
public IBinding[] find(String name, boolean prefixLookup) throws DOMException {
try {
- BindingFinder visitor= new BindingFinder(name.toCharArray(), prefixLookup);
+ BindingCollector visitor = new BindingCollector(getLinkageImpl(), name.toCharArray(), null, prefixLookup, !prefixLookup);
acceptInHierarchy(new HashSet(), visitor);
return visitor.getBindings();
} catch (CoreException e) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java
index aec5c60640a..91e5485ea2d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java
@@ -107,7 +107,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding implements ICPPNamespace, ICPPName
public IBinding[] find(String name, boolean prefixLookup) {
try {
- BindingCollector visitor = new BindingCollector(getLinkageImpl(), name.toCharArray(), null, prefixLookup, true);
+ BindingCollector visitor = new BindingCollector(getLinkageImpl(), name.toCharArray(), null, prefixLookup, !prefixLookup);
getIndex().accept(visitor);
return visitor.getBindings();
} catch (CoreException e) {
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FunctionReference_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FunctionReference_Prefix.java
index 6c24d5f45aa..b376ebed6dc 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FunctionReference_Prefix.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FunctionReference_Prefix.java
@@ -40,14 +40,14 @@ public class CompletionTest_FunctionReference_Prefix extends CompletionProposal
"xSecondEnum",
"xThirdEnum",
"xEnumeration",
- /* FIXME: DOM search is currently case sensitive? */
- "XMacro(x,y)"
+ "XMacro(x, y)",
+ "XStruct"
};
public CompletionTest_FunctionReference_Prefix(String name) {
super(name);
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109724
- setExpectFailure(109724);
+ //setExpectFailure(109724);
}
public static Test suite() {
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_Prefix.java
index 135a26b3501..72842b52984 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_Prefix.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_Prefix.java
@@ -31,7 +31,6 @@ public class CompletionTest_NewTypeReference_Prefix extends CompletionProposals
"aClass",
"anotherClass",
"aNamespace",
- // missing proposal:
"AStruct"
// extra proposal:
// anEnumeration
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_Prefix.java
index 1c3e28ed4b1..e2d847c447b 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_Prefix.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_Prefix.java
@@ -38,7 +38,6 @@ public class CompletionTest_SingleName_Method_Prefix extends CompletionProposa
"aFirstEnum",
"aSecondEnum",
"aThirdEnum",
- // missing proposals:
"AStruct",
"AMacro(x)"
};
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Prefix2.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Prefix2.java
index ff6cf189e25..a7a288e0437 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Prefix2.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Prefix2.java
@@ -35,14 +35,14 @@ public class CompletionTest_SingleName_Prefix2 extends CompletionProposalsBaseT
"aFirstEnum",
"aSecondEnum",
"aThirdEnum",
- // missing proposal:
- "AMacro(x)"
+ "AMacro(x)",
+ "AStruct"
};
public CompletionTest_SingleName_Prefix2(String name) {
super(name);
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109724
- setExpectFailure(109724);
+ //setExpectFailure(109724);
}
public static Test suite() {
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java
index a82f1922788..ec7fe5f972d 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java
@@ -335,7 +335,7 @@ public class CompletionTests extends AbstractContentAssistTest {
//void C3::f() {e/*cursor*/
public void testEnums_MethodScope() throws Exception {
final String[] expected= {
- "e11", "e12", "e21", "e22", "E1"
+ "e11", "e12", "e21", "e22", "E1", "E2"
};
assertCompletionResults(fCursorOffset, expected, true);
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionProposalComputer.java
index 73aa44c341d..e2ab24d60ec 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionProposalComputer.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionProposalComputer.java
@@ -139,12 +139,12 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
IASTPreprocessorMacroDefinition[] macros = completionNode.getTranslationUnit().getMacroDefinitions();
if (macros != null)
for (int i = 0; i < macros.length; ++i)
- if (CharArrayUtils.equals(macros[i].getName().toCharArray(), 0, prefixChars.length, prefixChars, false))
+ if (CharArrayUtils.equals(macros[i].getName().toCharArray(), 0, prefixChars.length, prefixChars, true))
handleMacro(macros[i], context, proposals);
macros = completionNode.getTranslationUnit().getBuiltinMacroDefinitions();
if (macros != null)
for (int i = 0; i < macros.length; ++i)
- if (CharArrayUtils.equals(macros[i].getName().toCharArray(), 0, prefixChars.length, prefixChars, false))
+ if (CharArrayUtils.equals(macros[i].getName().toCharArray(), 0, prefixChars.length, prefixChars, true))
handleMacro(macros[i], context, proposals);
}

Back to the top