[Lazarus] Code completion improved

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jan 16 18:40:49 CET 2012


Hi all,

I improved the code completion for parameters. It can now create
methods/procedures for parameters and variables for pointers for
parameters. 

Here is an example for a procedure:

procedure TForm1.FormCreate(Sender: TObject);
var
  List: TList;
begin
  List:=TList.Create;
  List.Sort(@MySortFunction|);
end;

Place the cursor on 'MySortFunction' and press Ctrl+Shift+C for code
completion. You get a new procedure:

function MySortFunction(Item1, Item2: Pointer): Integer;
begin
  |
end;
 
procedure TForm1.FormCreate(Sender: TObject);
var
  List: TList;
begin
  List:=TList.Create;
  List.Sort(@MySortFunction);
end;


Here is an example for a pointer to a variable:

  procedure TForm1.FormCreate(Sender: TObject);
  begin
    CreateIconIndirect(@IconInfo|);
  end;

Place the cursor on 'IconInfo' and code completion will create:

  procedure TForm1.FormCreate(Sender: TObject);
  var
    IconInfo: TIconInfo;
  begin
    CreateIconIndirect(@IconInfo|);
  end;


Mattias




More information about the Lazarus mailing list