How do I get Delphi 2009s (Refactor) Extract Interface to work?

I am trying to use Delphi 2009 refactoring to extract an interface from a class. The class looks something like this:

Type
  TMyClass = class(TObject)
  private
    FPrivateVar: Integer;
  public
    procedure MyPublicProc(Value: String); 
    function MyPublicFunc(Value: String): String;
  end;

      

If I put the cursor in the public section, right click and select "Refactoring | Extract", there is a short pause, then ... nothing. What am I doing wrong?

0


a source to share


2 answers


I am using Delphi 2009 Version 12.0.3210.17555 (updates 1 and 2 installed) and I checked the function in your class ...

Until I only had your class interface and the method was not implemented, I got this error message:

The selection must contain one or more classes, or one or more class members.



I pressed Ctrl + Shift + C to complete the implementation of the class and tried again and it worked fine:

http://www.picoodle.com/view.php?img=/2/5/13/kykl1zna1e5r/f_ExtractIntem_4aaede9.png&srv=img30

+2


a source


In D2007, it works fine. (I had to enable / add support for the model, it asks for it automatically). When I click on the procedure (place the cursor somewhere in MyPublicProc for example) it works fine.



Do you see an error message when you open a Review View? (Delphi -> View -> Refactorings)

0


a source







All Articles