Index: D:/workspaces/hibernate/hibernate-tools.src/java/org/hibernate/tool/ide/completion/ConfigurationCompletion.java =================================================================== --- D:/workspaces/hibernate/hibernate-tools.src/java/org/hibernate/tool/ide/completion/ConfigurationCompletion.java (revision 14239) +++ D:/workspaces/hibernate/hibernate-tools.src/java/org/hibernate/tool/ide/completion/ConfigurationCompletion.java (working copy) @@ -48,16 +48,8 @@ String entityImport = (String) entry.getKey(); String entityName = (String) entry.getValue(); - if(entityImport.startsWith(prefix)) { - String remaining = entityImport.substring( prefix.length() ); - HQLCompletionProposal proposal = new HQLCompletionProposal( - HQLCompletionProposal.ENTITY_NAME, - cursorPosition); - proposal.setCompletion( remaining ); - proposal.setSimpleName( entityImport ); - proposal.setReplaceStart( cursorPosition ); - proposal.setReplaceEnd( cursorPosition+0 ); // we don't replace anything here - + if(entityImport.toLowerCase().startsWith(prefix.toLowerCase())) { + HQLCompletionProposal proposal = createStartWithCompletionProposal( prefix, cursorPosition, HQLCompletionProposal.ENTITY_NAME, entityImport ); proposal.setShortEntityName( entityImport ); proposal.setEntityName( entityName ); collector.accept(proposal); @@ -185,7 +177,7 @@ while ( allPropertiesIterator.hasNext() ) { Property property = (Property) allPropertiesIterator.next(); String candidate = property.getName(); - if (prefix.length() == 0 || candidate.startsWith(prefix)) { + if (prefix.length() == 0 || candidate.toLowerCase().startsWith(prefix.toLowerCase())) { HQLCompletionProposal proposal = createStartWithCompletionProposal( prefix, cursorPosition, HQLCompletionProposal.PROPERTY, candidate ); proposal.setEntityName( cmd.getEntityName() ); proposal.setProperty( property ); @@ -197,10 +189,10 @@ private HQLCompletionProposal createStartWithCompletionProposal(String prefix, int cursorPosition, int kind, String candidate) { HQLCompletionProposal proposal = new HQLCompletionProposal(kind, cursorPosition); - proposal.setCompletion( candidate.substring( prefix.length() ) ); + proposal.setCompletion( candidate ); proposal.setSimpleName( candidate ); - proposal.setReplaceEnd( cursorPosition ); - proposal.setReplaceStart( cursorPosition ); + proposal.setReplaceStart( cursorPosition - prefix.length() );// replace prefix + proposal.setReplaceEnd( cursorPosition ); return proposal; } @@ -320,7 +312,7 @@ while ( props.hasNext() ) { Property element = (Property) props.next(); String candidate = element.getName(); - if (candidate.startsWith(prefix)) { + if (candidate.toLowerCase().startsWith(prefix.toLowerCase())) { HQLCompletionProposal proposal = createStartWithCompletionProposal( prefix, cursorPosition, HQLCompletionProposal.PROPERTY, candidate ); //proposal.setEntityName( cmd.getEntityName() ); ...we don't know here..TODO: pass in the "path" proposal.setPropertyName( candidate ); @@ -339,7 +331,7 @@ for (int cnt = i; cnt < words.length; cnt++) { String word = words[cnt]; - if(word.startsWith(prefix)) { + if(word.toLowerCase().startsWith(prefix.toLowerCase())) { HQLCompletionProposal proposal = createStartWithCompletionProposal( prefix, cursorPosition, kind, word ); hcc.accept( proposal); } else {