Kai Grossjohann writes:
> Paul Kinnucan <[EMAIL PROTECTED]> writes:
>
> > Kai Grossjohann writes:
> > > Paul Kinnucan <[EMAIL PROTECTED]> writes:
> > >
> > > > Kai Grossjohann writes:
> > > > > Then position point after "this." and invoke jde-complete (in one
> > of
> > > > > its flavors). Observe how it adds an import statement for
> > > > > javax.swing.Action.
> > > >
> > > > This is because javax.swing.Action is the only class on the classpath
> > > > at this point. Compile your Action class and then retry the
> > completion.
> > > > The JDEE should then prompt you to choose one of the Action classes
> > > > to import.
> > >
> > > Hm. I just invoked "javac Action.java", then tried again. Now I get
> > > "no completion". The environment variable $CLASSPATH starts with
> > > ".:", and Action.class is in the current working directory, together
> > > with Action.java and BTest.java.
> >
> > What is the setting of jde-resolve-relative-paths-p?
>
> t
I asked this to determine whether the JDEE on your project was treating the
. character as meaning the current directory or the directory of the project
file for the current project.
The default setting of jde-resolve-relative-paths-p is t, which means
that the JDEE replaces the . in a path with the path of the directory
containing the project file for your project. If your project does not
have a project file, then the JDEE replaces the . with the path of the
current directory. I don't know whether you are using a project file
so I don't know how . is being resolved on your system.
In any case, I performed the following experiment
1. I created an environment variable CLASSPATH equal to a single . (period).
2. I restarted Emacs.
3. I created a directory named test.
4. In test, I created a file called Action.java containing
public class Action {
public int foo() {
return 42;
}
}
5. In test, I created a filed called BTest.java containing
public class BTest extends Action {
public int bar() {
return this.
}
}
6. I tried to complete
return this.
The JDEE imported
javax.swing.Action;
This is because the JDEE noticed that BTest extends a class named
Action and the only class of that name on the classpath at this
point is javax.swing.Action.
The JDEE also signaled a no completion error. That is because
BTest.java has not yet been compiled and hence is not on the classpath
and hence cannot be completed because the JDEE only knows about classes
that are on the classpath, i.e., that have been compiled.
7. I erased the import statement in BTest.java and changed
return this;
to
return 1;
so that BTest.java could be compiled.
8. I compiled Action.java and BTest.java.
9. In BTest.java, I changed the line
return 1;
to
return this.
10. I tried to complete
return this.
^
The JDEE, as I expected, displayed a menu of the default members
that BTest class inherits from Class class for completion.
Based on this experiment, I believe that JDEE 2.3.4 handles the test case
that you presented correctly within its limitations, i.e., that it only
imports and completes things that are on the classpath.
Paul