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?
But that's already provided there. What version of EPIC are you using?
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.
That is, I am using EPIC 0.3.0 which I believe uses editor plug-in 0.1.2
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.
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.
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.
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.
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.
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?
Is there any way I can see why EPIC is generating the error dialog?
The Eclipse log doesn't show anything for this.
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.
Yes, the directory exists and the module is present:
perlutils: ls -lR modules
drwxr-xr-x 3 matisse staff 102 18 Jan 08:28 Devel
-rw-r--r-- 1 matisse staff 8640 18 Jan 08:28 Refactor.pm
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.
> is your syntax validation working?
Hmmm. It seems it is NOT working.
What could cause this?
check your Perl interpreter preferences.
As long as the syntax validation is not working, refactoring won't work.
Yes I had checked that.
It was: perl
and I have also tried "/usr/bin/perl"
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.
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.
Only for this point, would it not better to have this interdependence somehow checked, when the menu is present or not?
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
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?
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.
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.
yes, exactly :)
Just contact me by eMail.
the Devel::Refactor module in EPIC has been updated to version 0.03.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.