Author Topic: Refactoring  (Read 3260 times)

Christoph

  • Senior Community Member
  • Posts: 114
  • Hero Points: 6
Refactoring
« on: August 13, 2008, 01:04:37 pm »
Is there a way to get the refactoring feature to work with non-compiled languages that support some level of OOP (e.g. perl, php, et. al.)?  If so, how?  If not, is this something that can be included in a future release?

thnx,
Christoph

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Refactoring
« Reply #1 on: August 18, 2008, 02:23:12 am »
I think that the "quick" refactorings should work with any language that has tagging support.  I'm not sure if they'll accomplish everything you are looking for, but there's stuff like Quick Rename, Quick Extract Method, Quick Modify Parameter List, etc.

- Ryan

Christoph

  • Senior Community Member
  • Posts: 114
  • Hero Points: 6
Re: Refactoring
« Reply #2 on: August 18, 2008, 12:11:47 pm »
I think that the "quick" refactorings should work with any language that has tagging support.  I'm not sure if they'll accomplish everything you are looking for, but there's stuff like Quick Rename, Quick Extract Method, Quick Modify Parameter List, etc.

Even just those features you mention above would be great.  But right now I'm using SE2k8 (13.0.1.0) for coding PHP and the only thing that is not grayed out when I go to Tools -> Quick Refactoring is the "Rename" menu option.  "Extract Method", "Modify Parameter List" and "Replace Literal with Constant" are all unavailable no matter what I do. 

Is there something I am missing?  Something specific I should be doing?

thnx,
Christoph

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Refactoring
« Reply #3 on: August 18, 2008, 02:59:44 pm »
Ok I looked at the code, and I was wrong  :-\.  Quick Refactoring is based off tagging but simply because a language has tagging support does not mean that all the operations are supported:

  • Quick Modify Params - This currently only supports for Java and C++.
  • Quick Replace Literal with Constant - This currently only supports Java, C++, and Slick-C.

It looks like Quick Extract Method should work for PHP.  As long as the language has a _LANGNAME_generate_function function written for it, which PHP has, it should be supported.  Also, you need to have the code you wish to extract to a method selected as a non-block selection.  If it's not working for you do you have a code sample I could check out?

I'm not sure of our future plans for support more languages with refactorings, Scott W. is probably the only one who could comment on that...

- Ryan