Bug 47222 - Code Assist does not show methods if the return type is not on the classpath
Summary: Code Assist does not show methods if the return type is not on the classpath
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-21 09:19 EST by Alasdair Nottingham CLA
Modified: 2004-05-11 05:49 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alasdair Nottingham CLA 2003-11-21 09:19:49 EST
I don't know if this is 3.0 specific or not. I also suspect that it has been put
in on purpose, however I find it very irritating. The basic problem is that code
assist hides methods if you are unable to use them because you do not have a
class imported.

This is even more iritating if I want to call methodA and pass the result into
methodB without an assignment, so the call to methodA occurs within the
parameter list of methodB. In order to see these methods I have to import the
class, which will then give me a warning stating that the import is not used.

I think that while this feature may seem good on the outside it is very
irritating when you find that you cannot invoke a method because of a lack of an
import. In many occasions I have to create a variable of that type and them
remove it just to see the method.

Very irritated
Alasdair
Comment 1 Philipe Mulet CLA 2003-11-21 09:46:46 EST
Please provide exact steps to reproduce.
Comment 2 Alasdair Nottingham CLA 2003-11-27 08:50:59 EST
I have looked further into the problems I have been experiencing, and while I
thought it was because I didn't have the class imported it was in fact because I
did not have the class on the classpath. The steps needed to reproduce this are
given below.

The example given is simple, the more common one I come across is that the
method I am calling throws an exception that extends another exception that I do
not have on the classpath. In my environment I have projects for relativly small
 units of function, with interdependencies on each other. The real problem this
introduces is when a project I depend on requires another one my project does
not directly rely on but my project still needs to have it on its classpath. 

So steps to reproduce.

Create Project A
Create Class A in project A
Create Project B
Create Class B in project B
Create method getA in class B that returns A
Create Project C
Setup class path in C so it references B, but not A
Create Class C in project C
Create method C in project C
Attempt to use quick assist to put in a call to getA
Comment 3 David Audel CLA 2004-05-11 05:49:49 EDT
Code assist try to propose only correct code. If A is not inside classpath 
then a call to getA produce a compile error. So getA is not proposed.

Work as designed.

Closed.