Adding Refactoring to EPIC

matisse wrote on Sun Jan 16 01:36:59 CET 2005:
I would like to help add at least basic refactoring support in EPIC.

I am not a Java programmer but I am willing to spend time on this, designing,
coordinating, documenting, etc.

Is anyone else interested in doing this?
leo_forge wrote on Mon Jan 17 09:35:30 CET 2005:
But that's already provided there. What version of EPIC are you using?
matisse wrote on Mon Jan 17 17:33:32 CET 2005:
The very latest I believe - editor plug-in 0.1.2
The Refactor" menu is not visible when editing .pm or .pl file

Please show me that I have foolishly overlooked something - I would LOVE
to be able to refactor Perl code using EPIC.
matisse wrote on Mon Jan 17 17:35:04 CET 2005:
That is, I am using EPIC 0.3.0 which I believe uses editor plug-in 0.1.2
luelljoc wrote on Tue Jan 18 10:43:40 CET 2005:

as far as refactoring is concerned EPIC only support "extract subroutine"
throught the Devel::Refactor module.
Currently the module does not work very well. I hope the quality of the
module will improve in the future.

It would be a good thing to extend refactoring support.

If I can be of any help, let me know, although my time is very limited at
the moment.

matisse wrote on Tue Jan 18 17:03:33 CET 2005:
Thank you for pointing out Devel::Refactor. How can it be added to EPIC?

If there is a way to have EPIC use Perl modules for refactoring then I can
be of more help, since I do know Perl :-)

Even having "extract subroutine" would be a big step, and if we can provide
a framework for developers to add refactoring tools I am sure I can help
find people who will work on it.

luelljoc wrote on Tue Jan 18 17:11:54 CET 2005:

refactoring using Devel::Refactor is already implemented (I think it's implemented
in the latest testing).
Yes EPIC can use Perl modules, this might not be optimal performance wise,
but so far it works ok.


matisse wrote on Tue Jan 18 17:40:02 CET 2005:
Thank you.

I've installed EPIC 0.3.8 and if I select some code and right-click I see
the Refactor choice. When I choose "Extract subroutine" I get a diaglog
box that says "Subroutine could not be generated."

I tried this with as little as a single line of code.
luelljoc wrote on Tue Jan 18 18:09:45 CET 2005:

strange, it works for me.
After selecting the code and executing "Extract Subroutine" you should get
a dialog asking for the name of the subroutine to generate.

matisse wrote on Tue Jan 18 18:59:10 CET 2005:
Yes, after executing "Extract subroutine" I do get that dialog asking for
the subroutine name, sorry IO forgot to post that. I enter a name, and click
"OK", and then I get the second, error dialog.

I notice that the first dialog, the one that asks for the subroutine name,
has two text fields. I can only make entries in the first one. Does that
have anything to do with this?
matisse wrote on Wed Jan 19 18:44:55 CET 2005:
Is there any way I can see why EPIC is generating the error dialog?
The Eclipse log doesn't show anything for this.
luelljoc wrote on Wed Jan 19 18:55:12 CET 2005:

i had a look at the source code.
The error is generated if the module return a zero string. If somehow the
module is not found or perl can not be executed the same error might occur.
The module should be located in the "perlutils/modules" directory of the
perleditor plugin directory.
So you could check, if the above directory does exist and if the Devel::Refactor
module is present.

matisse wrote on Wed Jan 19 20:21:19 CET 2005:
Yes, the directory exists and the module is present:

perlutils: ls -lR modules
total 0
drwxr-xr-x  3 matisse  staff  102 18 Jan 08:28 Devel

total 24
-rw-r--r--  1 matisse  staff  8640 18 Jan 08:28

luelljoc wrote on Wed Jan 19 20:37:33 CET 2005:

this might be a silly question: is your syntax validation working?
Just want to make sure that the Perl call is working ok.
If Perl is working we'll have to find a way to track the problem.

matisse wrote on Wed Jan 19 20:52:57 CET 2005:
>  is your syntax validation working? 

Hmmm.  It seems it is NOT working.
What could cause this?
luelljoc wrote on Wed Jan 19 20:58:27 CET 2005:

check your Perl interpreter preferences.
Window->Preferences->Perl EPIC

As long as the syntax validation is not working, refactoring won't work.

matisse wrote on Wed Jan 19 21:13:59 CET 2005:
Yes I had checked that.

It was:    perl
and I have also tried "/usr/bin/perl"
leo_forge wrote on Thu Jan 20 16:37:47 CET 2005:
Even the option is turned on, does not mean validation works or not. Try
simple out with only one line 


since the ; is missing there should be a mark right in the outline to indicate
an error as well in the Problems.

Additionally could you please the check the Eclipse-log-file (found in workspace\metadata\.log)
if there is any kind of error there. if there is, then it would be good
to know, where it happens, ie. which module, which line.
matisse wrote on Thu Jan 20 17:15:49 CET 2005:
I tried testing, using your example of

and several others  and nothing happend, and the Eclipse error log show
nothing for this - last error message is from yesterday.

I also checked to see if validation is working for Java, and it is.
leo_forge wrote on Thu Jan 20 16:32:30 CET 2005:
Only for this point, would it not better to have this interdependence somehow
checked, when the menu is present or not?
matisse wrote on Sun Jan 23 02:03:20 CET 2005:
I started a new Perl project and it that one syntax validation AND refactoring
work. Hurray!!

Now I am trying to understand how to get Syntax Validation to  clear errors
when a correction is made in a module imported with
    use MyModule;

But that is a separate issue. For this thread I am happy to report that
"extract subroutine" works.

If I were able to add new methods to Devel::Refactor, how could I make them
available in EPIC?
luelljoc wrote on Mon Jan 24 10:13:00 CET 2005:

good to hear that it's working :)
In principle you can write Perl modules. How to make them available in Eclipse
depends a little bit on what the module is doing.
But if you are a Perl programmer you could concentrate on the Perl part
and somebody else could do the Eclipse integration.

matisse wrote on Mon Jan 24 18:55:23 CET 2005:
I have already submitted a patch to the maintainer of Devel::Refactor that
makes some small improvements in Devel::Refactor.

Maybe if I add a new method to Devel::Refactor someone else can make that
method available in EPIC.
luelljoc wrote on Tue Jan 25 07:43:11 CET 2005:

yes, exactly :)
Just contact me by eMail.

luelljoc wrote on Sat Jan 29 18:38:00 CET 2005:
the Devel::Refactor module in EPIC has been updated to version 0.03.


Note: The above is an archived snapshot of a forum thread. Use the original thread at to post comments.