I see two ways of approaching getting some refactoring functionality in JDE:

1) Use the parse information from semantic with perhaps a semanticdb
backend for jar and class files using jde-usages. Semantic didn't
parse java methd bodies when I last checked so this restricts the
kinds of refactoring we can do. This is probably the "right" way to do
refactoring but it will take a lot of time before we can do all the
refactorings other IDEs provide.

2) Use an external refactoring tool to do the heavy lifting. I've
spent some time looking at jrefactory which seems to be frequntly
updated and was designed with the object being plugged into a IDE. All
the IDEs it is being used with are written in java so I'm not sure how
well it will work for us. The refactoring libraries from the eclise
project are another option but they seem to be very tightly integrated
into their IDE.

Here are a list of refactoring operations that jrefactory says it can
do : http://jrefactory.sourceforge.net/csrefactory.html

I use Extract Method and Rename Method the most. 

You can use jde-usages as a start to rename a method. I even tried to
automate it using a macro but discarded it because jde-usages can only
tell you the line on which the method call exists, so if there is
another method with the same name called on the line, or of it method
name is mentioned in a comment its hard to figure out automatically
where the method call is.

Extract method, where the IDE converts some code into a method and
guess the inputs and outputs, seems much harder.


I'm not suggesting that we should choose one of the two approaches,
but that we should do both - initially do simpler refactorings using
semantic and punt the more complicated global ones to an external tool
while we figure out how to do them in emacs.

Suraj


On Thu, 30 Sep 2004 13:50:45 -0400, Paul Kinnucan <[EMAIL PROTECTED]> wrote:
> 
> 
> Raul Acevedo writes:
>  > I know this question comes up at least once a year.  I figure it's about
>  > time to ask again, in case new tools have come up.
>  >
>  > How do you do refactoring in Emacs/JDEE?  Are there plans to include
>  > refactoring into JDEE at some point?
> 
> My plan originally was to use xref as a basis for factoring commands. Now it appears 
> that jde-usages might be a better basis. I need input on what kind
> of factoring commands users want.
> 
> Paul
> 
>

Reply via email to