1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Partial fix for bug#58178

This commit is contained in:
Hoda Amer 2004-04-14 15:52:44 +00:00
parent 88528b8277
commit 358bcc3424
2 changed files with 10 additions and 5 deletions

View file

@ -1,3 +1,6 @@
2004-04-14 Hoda Amer
Partial fix for bug#58178 : [Content Assist] No completion on GL_TRUE
2004-04-13 Hoda Amer 2004-04-13 Hoda Amer
Fix for bug#57804: [Refactoring] Constructor and Destructor are not refactored when class is defined inside a namespace Fix for bug#57804: [Refactoring] Constructor and Destructor are not refactored when class is defined inside a namespace

View file

@ -396,18 +396,20 @@ public class CompletionEngine implements RelevanceConstants {
String key = (String) i.next(); String key = (String) i.next();
String value = ""; //$NON-NLS-1$ String value = ""; //$NON-NLS-1$
if(key.length() > prefix.length()) { if(key.length() > prefix.length()) {
value = key.substring(0, prefix.length()); value = key.substring(0, prefix.length()).toUpperCase();
}else { }else {
value = key; value = key;
} }
if( value.equalsIgnoreCase( prefix ) ) { String newPrefix = prefix.toUpperCase();
if( value.equals( newPrefix ) ) {
IMacroDescriptor macroD = (IMacroDescriptor)macroMap.get(key); IMacroDescriptor macroD = (IMacroDescriptor)macroMap.get(key);
if (macroD.getMacroType() == IMacroDescriptor.MacroType.FUNCTION_LIKE ) if (macroD.getMacroType() == IMacroDescriptor.MacroType.FUNCTION_LIKE )
resultSet.add( macroD.getCompleteSignature() ); resultSet.add( macroD.getCompleteSignature() );
else else
resultSet.add( macroD.getName() ); resultSet.add( macroD.getName() );
} }
else if( value.compareToIgnoreCase( prefix ) > 0 ) else if( value.compareTo( newPrefix ) > 0 )
break; break;
} }
return resultSet; return resultSet;
@ -619,13 +621,13 @@ public class CompletionEngine implements RelevanceConstants {
} }
public IASTCompletionNode complete(IWorkingCopy sourceUnit, int completionOffset) { public IASTCompletionNode complete(IWorkingCopy sourceUnit, int completionOffset) {
log(""); //$NON-NLS-1$
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
// 1- Parse the translation unit // 1- Parse the translation unit
IASTCompletionNode completionNode = parse(sourceUnit, completionOffset); IASTCompletionNode completionNode = parse(sourceUnit, completionOffset);
log(""); //$NON-NLS-1$
if (completionNode == null){ if (completionNode == null){
log("Null Completion Node Error"); //$NON-NLS-1$ log("Null Completion Node Error"); //$NON-NLS-1$
return null; return null;