Adding Refactoring to EPIC

2005-01-16
2013-05-20
  • Matisse Enzer

    Matisse Enzer - 2005-01-16

    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

      LeO - 2005-01-17

      But that's already provided there. What version of EPIC are you using?

       
    • Matisse Enzer

      Matisse Enzer - 2005-01-17

      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 Enzer

        Matisse Enzer - 2005-01-17

        That is, I am using EPIC 0.3.0 which I believe uses editor plug-in 0.1.2

         
    • Jochen Ruehl

      Jochen Ruehl - 2005-01-18

      Hi,

      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.

      Bye
      Jochen

       
    • Matisse Enzer

      Matisse Enzer - 2005-01-18

      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.

       
      • Jochen Ruehl

        Jochen Ruehl - 2005-01-18

        Hi,

        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.

        Bye
        Jochen

         
    • Matisse Enzer

      Matisse Enzer - 2005-01-18

      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.

       
      • Jochen Ruehl

        Jochen Ruehl - 2005-01-18

        Hi,

        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.

        Bye
        Jochen

         
        • Matisse Enzer

          Matisse Enzer - 2005-01-18

          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 Enzer

          Matisse Enzer - 2005-01-19

          Is there any way I can see why EPIC is generating the error dialog?
          The Eclipse log doesn't show anything for this.

           
          • Jochen Ruehl

            Jochen Ruehl - 2005-01-19

            Hi,

            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.

            Bye
            Jochen

             
            • Matisse Enzer

              Matisse Enzer - 2005-01-19

              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

              modules/Devel:
              total 24
              -rw-r--r--  1 matisse  staff  8640 18 Jan 08:28 Refactor.pm

               
              • Jochen Ruehl

                Jochen Ruehl - 2005-01-19

                Hi,

                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.

                Bye
                Jochen

                 
                • Matisse Enzer

                  Matisse Enzer - 2005-01-19

                  >  is your syntax validation working?

                  Hmmm.  It seems it is NOT working.
                  What could cause this?

                   
                  • Jochen Ruehl

                    Jochen Ruehl - 2005-01-19

                    Hi,

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

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

                    Bye
                    Jochen

                     
                    • Matisse Enzer

                      Matisse Enzer - 2005-01-19

                      Yes I had checked that.

                      It was:    perl
                      and I have also tried "/usr/bin/perl"

                       
                      • LeO

                        LeO - 2005-01-20

                        Even the option is turned on, does not mean validation works or not. Try simple out with only one line

                        print
                        $1=0

                        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 Enzer

                          Matisse Enzer - 2005-01-20

                          I tried testing, using your example of
                          print
                          $1=0

                          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

                      LeO - 2005-01-20

                      Only for this point, would it not better to have this interdependence somehow checked, when the menu is present or not?

                       
                • Matisse Enzer

                  Matisse Enzer - 2005-01-23

                  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?

                   
                  • Jochen Ruehl

                    Jochen Ruehl - 2005-01-24

                    Hi,

                    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.

                    Bye
                    Jochen

                     
                    • Matisse Enzer

                      Matisse Enzer - 2005-01-24

                      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.

                       
                      • Jochen Ruehl

                        Jochen Ruehl - 2005-01-25

                        Hi,

                        yes, exactly :)
                        Just contact me by eMail.

                        Bye
                        Jochen

                         
                      • Jochen Ruehl

                        Jochen Ruehl - 2005-01-29

                        Hi,
                        the Devel::Refactor module in EPIC has been updated to version 0.03.

                        Bye
                        Jochen

                         

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks