Re: jde-complete generates imports I don't want

2004-11-18 Thread Kai Grossjohann
Paul Kinnucan [EMAIL PROTECTED] writes:

 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.

I verified that the same thing happens with the test case in my
environment.  I didn't realize that one has to compile both *.java
files to make it work.

So now I need to work on getting a test case that demonstrates the
problem: the problem still happens with the real code that I'm
editing.

One difference between the test case and the real code is that the
real code is compiled, jared (jarred? jar'd?) and the *.jar file is in
$CLASSPATH.  But the *.class files are NOT in $CLASSPATH.

Another difference is that the real project has a prj.el file whereas
the test case didn't have one.


I'm sure that this is pilot error; I just don't know what I'm doing
wrong.

Kai



jde-complete generates imports I don't want

2004-11-15 Thread Kai Grossjohann
Create a file A.java with the following contents:

public class A {
public static int main(String[] args)
{
A a = new A();
a.@
}
}

Position point on @, delete the character, then hit C-c C-v . and
observe how it adds import org.apache.ecs.xhtml.a; to the beginning
of the file.

Or this one: create a file Action.java that looks like this:

public class Action {
public int foo() {
return 42;
}
}

Then create a file BTest.java that looks like this:

public class BTest extends Action {
public int bar() {
return this.
}
}

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.

Is it pilot error?

Is it just me?

Kai

PS: Using jde 2.3.4 on GNU Emacs 21.3.50.1 (i386-pc-linux-gnu, X
toolkit, Xaw3d scroll bars) of 2004-11-02 on ketchup, modified by
Debian.



jde-complete generates imports I don't want

2004-11-15 Thread Paul Kinnucan
Kai Grossjohann writes:
  Create a file A.java with the following contents:
  
  public class A {
  public static int main(String[] args)
  {
  A a = new A();
  a.@
  }
  }
  
  Position point on @, delete the character, then hit C-c C-v . and
  observe how it adds import org.apache.ecs.xhtml.a; to the beginning
  of the file.

Because there is a class named a on hyour classpath, the JDEE assumes
that you are trying to complete a static member of that class and
therefore creates an import statement for class a. As it is unlikely
that you will ever intend to use class a in your programs, you can
easily deal with this problem by excluding the org.apache.ecs class
from importation via jde-import-excluded-classes.


  
  Or this one: create a file Action.java that looks like this:
  
  public class Action {
  public int foo() {
  return 42;
  }
  }
  
  Then create a file BTest.java that looks like this:
  
  public class BTest extends Action {
  public int bar() {
  return this.
  }
  }
  
  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.

Paul

  
  Is it pilot error?
  
  Is it just me?
  
  Kai
  
  PS: Using jde 2.3.4 on GNU Emacs 21.3.50.1 (i386-pc-linux-gnu, X
  toolkit, Xaw3d scroll bars) of 2004-11-02 on ketchup, modified by
  Debian.