Bug 4964 Automatic Code Assist needs to be smarter
Build 204 While writing SWT code, I type the following: button.dispose At this point, I do not realize that the code assist list is up because I am not looking. There are 2 items in the list now: DISPOSED int - Widget dispose() void - Widget I then type "(" because the line I was typing was supposed to be: button.dispose(); But as soon as I type the "(" then automatic code assist seems to insert whatever is selected. Since DISPOSED is first in the list and is selected, I ended up with: button.DISPOSED which isn't even close to what I want, and I have to delete it all and start again, paying more attention this time. Code assist should notice that I have typed a ( and that this matches "dispose ()" far better than "DISPOSED". Either that, or it needs to be case sensitive when it is automatically inserting stuff.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ResultCollector.java
public void acceptMethod(char[] declaringTypePackageName, char[] declaringTypeName, char[] name,
		char[][] parameterPackageNames, char[][] parameterTypeNames, char[][] parameterNames,
		char[] returnTypePackageName, char[] returnTypeName, char[] completionName, int modifiers,
		int start, int end) {
	
		JavaCompletionProposal proposal= createMethodCompletion(declaringTypeName, name, parameterTypeNames, parameterNames, returnTypeName, completionName, modifiers, start, end);
		proposal.setProposalInfo(new ProposalInfo(fJavaProject, declaringTypePackageName, declaringTypeName, name, parameterPackageNames, parameterTypeNames, returnTypeName.length == 0));
		boolean hasClosingBracket= completionName.length > 0 && completionName[completionName.length - 1] == ')';
	
		ProposalContextInformation contextInformation= null;
		if (hasClosingBracket && parameterTypeNames.length > 0) {
			contextInformation= new ProposalContextInformation();
			contextInformation.setInformationDisplayString(getParameterSignature(parameterTypeNames, parameterNames));		
			contextInformation.setContextDisplayString(proposal.getDisplayString());			
			proposal.setContextInformation(contextInformation);
		}
	
		boolean userMustCompleteParameters= (contextInformation != null && completionName.length > 0);
		char[] triggers= userMustCompleteParameters ? METHOD_WITH_ARGUMENTS_TRIGGERS : GENERAL_TRIGGERS;
		proposal.setTriggerCharacters(triggers);
		
		if (userMustCompleteParameters) {
			
			proposal.setCursorPosition(completionName.length - 1);
		}
		
		fMethods.add(proposal);
		
		if (returnTypeName.length == 0 && fCompilationUnit != null) {
			proposal= createAnonymousTypeCompletion(declaringTypePackageName, declaringTypeName, name, parameterTypeNames, parameterNames, completionName, start, end);