Suggestion: package object renaming

Stew Stryker

Member³
I occasionally decide to rename of a package function/procedure. It'd be great if Developer could automate that.

While I'm wishing, I wish Developer (or a plug-in) could assist with additional code refactoring options (do a search on 'refactoring fowler' for more info).

Here's how I'd like the renaming to work:

  1. I point to the function on the Code Contents window,
  2. Right-click over it and choose Refactoring->Object Rename
  3. A dialog shows what it thinks as the old name, then prompts for the new name.
  4. All references to the old name in the package spec and body are changed to the new name.
Another refactoring I'd love to see would be when you change a package's function signature. Say you add a new parameter in the package body. You get an option in the Code Contents context menu to update the package spec from the body. You'd also want the reverse to happen if you update the spec first, then want to update the body.

Care would have to be taken for overloaded functions.

I wonder if these even could be done in a plug-in???

Thanks for listening,

Stew
 
Great idea!

You have my vote for it. There is also another thing I would like to see: move package objects to another package (having procedure proc_A in package A I now think that it is better placed on package B. So I want to be able to select proc_A and tell it to be moved to package B and all references should be adapted).

greetings,
Uli
 
We discussed this internally recently. The PL/SQL parser that we have in PL/SQL Developer should allow for several refactoring functions. It's definitely on the to-do list.
 
Very funny, Uli!

Marco, if you guys start planning for this feature, let us know and we can start suggesting our favorite refactors!

Thanks for considering it.

Stew
 
I'd like to have access to the parser so that I could write a plug-in. Our code is losing it's white space, the blank lines that make it humanly readable, and I'd like something that automatically puts it back in (though I have asked for a change to the Beautifier to do the same thing, having access to the parser output would make more things possible).
 
A Refactoring plugin for PLSQL Developer would be great!

Being able to access the Code parsed tree I would like to see something similar to CodeDom (optionally serializable to XML) in .NET although I do understand that you're looking for a lean interface in the plugin API.

What I'm dreaming of longterm is the option to have PLSQL devloper as a tool inside VS.NET and Borland Developer Studio (Delphi). Then the PLSQL CodeDom idea would make sense again...
 
Just found a Blog entry which describes what I meant in the above message

It describes the usage of Delphi CodeDOM for BDS IDE plugins. Something for PL/SQL Developer 7?
 
If you're refactoring, you probably can't find a simpler one than sorting a packages procedures and functions alphabetically within the package spec and body.

I find having the code sorted makes it easier to compare the saved package with previous versions from my VCS system.

I just tried doing that yesterday by drag-n-drop of a package function in the Code Contents window. But it wouldn't let me. Then I tried cut-n-paste by right-clicking on function in Code Contents window and Pasting. Unfortunately it overwrote the object that was already there. Not quite what I was going for. :-(

Maybe it would be simpler to add support w/in the Code Contents window for drag-n-drop?

I glanced at the description of CodeDOM supplied, but finished as clueless as I started. Sorry I didin't have enough understanding of Delphi, .NET or CodeDOM to catch on.

- Stew
 
Back
Top