Refactoring - Procedures

orca777

Member³
Hi, if i refactor a code block in a pacahte to extract it as procdures all works fine but the 'IS' is missing :

Code:
-- Refactored procedure Cleanup_en_gb
  procedure Cleanup_en_gb
  begin
    DELETE Textresource Tr
     WHERE (Tr.Key, Tr.Locale, Tr.Category) NOT IN
           (SELECT Itr.Key,
                   Cn_En_Gb,
                   Itr.Category
              FROM Imp_Textresource Itr)
       AND Tr.Locale = Cn_En_Gb;

    Eventlogmgr.Logappinfo(0,
                           SQL%ROWCOUNT || ' ' || Cn_En_Gb ||
                           ' resources cleaned up',
                           'Textresource_Util',
                           'Import');
  end Cleanup_en_gb;
Karl
Ps.: Refactoring is a great feature!
 
I see this bug was fixed in the trial version 7.0.0.1050. :)

Overall, VERY nice work with these refactoring tools! :D

I did notice that if you edit a package refactor/rename a public procedure, the package specification does NOT change. I guess I could see that as a safety feature, but...

Do you have any plans to public updates with additional refactor features?

For example

* When editing a package body you change the signature of a public procedure, so the refactor publishes the new signature to the package specification.

* Extract selected lines of code to a function (versus the current extract to procedure).
 
I did notice that if you edit a package refactor/rename a public procedure, the package specification does NOT change. I guess I could see that as a safety feature, but...
The refactoring function is restricted to the current editor. I suppose we could extend it to the package specification if it is also opened in the same Program Window. I have added this to the list of enhancement requests.
Do you have any plans to public updates with additional refactor features?
We are open to suggestions. We can easily add them in subsequent 7.0.x releases.
Extract selected lines of code to a function (versus the current extract to procedure).
I guess this would require that you should can designate a variable from used inside and outside the selection as return value/type. That would work.
 
quote:Extract selected lines of code to a function (versus the current extract to procedure).

I guess this would require that you should can designate a variable from used inside and outside the selection as return value/type. That would work.
I think it'd be very cool if the refactor dialog box prompted for a new variable name and type, but I wouldn't snear if it left me to do that! So I'd be happy if it just left something like:

Code:
??? := my_new_function_name(param1, param2);
Cool stuff!
 
I think an existing variable would be appropriate. If the piece of code produces a result, then there must already be a variable that holds this result. This variable can be used to determine the function result type, is returned in the function, and can be used in the assignment.
 
Back
Top