Bug 4966 - Automatic Code Assist needs to be smarter #2
Summary: Automatic Code Assist needs to be smarter #2
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: Other other
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Kai-Uwe Maetzel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-15 00:53 EDT by Carolyn MacLeod CLA
Modified: 2001-12-19 06:16 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carolyn MacLeod CLA 2001-10-15 00:53:53 EDT
I was trying to type the following into a subclass of JUnit's TestCase class:

static public void assertEquals(String message, int expected[], int actual[]) {
	boolean equal = false;
	... // other stuff here
	if (!equal) {

When I got to the 'if' statement and typed the opening "(" the automatic code 
assist came up. I kept typing "!equal" but when I typed the closing ")" I was 
surprised to see that code assist stayed active. I kept typing the space and 
the open "{". At that point, code assist decided to automatically insert 
something bogus for me, and my line ended up looking like this:

	if (!equal) actual{
Comment 1 Carolyn MacLeod CLA 2001-10-15 01:05:31 EDT
A similar case, showing additional problems:
Trying to type:

public boolean isClassTestable (ClassFile cf) {
	int flags = cf.accessFlags();
	...
	new String(cf.className()).indexOf('$') == -1

When typing the last line, "(" brings up automatic code assist,
then type cf,
then "." halts the automatic code assist but does not trigger a new one.
(which is fine by me, really, but it might not be what you want... <g>)
Keep typing (ignoring the code assist) and after you type "className())" and 
then "." you suddently get a bogus extra "cf" inserted into your code before 
the "." as follows:

new String(cf.className())cf.

Comment 2 Carolyn MacLeod CLA 2001-10-15 01:20:06 EDT
Another one, this time with ";".

While typing this:

out.write(buf,0,buf.length);

you get this:

out.write(buf,0,buf.length)buf;
Comment 3 Kai-Uwe Maetzel CLA 2001-12-19 06:16:31 EST
Build 20011218.