[lazarus] Updates

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Feb 28 08:32:41 EST 2002


Hi all,

I have completed the Complete Code insert policies. see Environment->CodeTools->Code Creation.
The insert policies define the way, where the Complete Code function will add new variables, method definitions and method bodies. 
The 'Class part insert policy' defines where variables and property access methods will be added to the class definition.
For example:

  property MyInteger: integer;

will be completed to
  property MyInteger: integer read fMyInteger write SetMyInteger;

and it will add two new lines:
  fMyInteger: integer;
  procedure SetMyInteger(const AValue: integer);

If you set 'Class part insert policy' to 'Last' the new lines will be appended to already existing variables/method definitions. So, private variables will grow down.
If you set 'Class part insert policy' to 'Alphabetically' the new lines will be inserted in alphabetical order. For example if there is already a variable 'Z: integer;', then 'fMyInteger: integer;' will be inserted in front of Z.

The 'Method insert policy' defines where method bodies will be inserted in the code (e.g. implementation section). The above property write access method 'SetMyInteger' also creates a method body:

procedure MyClass.SetMyInteger(const AValue: integer);
begin

end;

If 'Method insert policy' is set to 'Last' the new proc will be added behind the last already existing method. i.e. new method will be appended at the end.
If 'Method insert policy' is set to 'Alphabetically' the new proc will be added behind an already existing method, which is alphabetically in front. So, if you keep your method bodies in alphabetical order, these policy will keep the order.
If 'Method insert policy' is set to 'Class order' the new proc will be added at the corresponding code in the class. For example, if you have a method definition

TMyClass = class
  procedure DoSomething;
end;

and you add 'DoIt'

TMyClass = class
  procedure DoSomething;
  procedure DoIt;
end;

Then the new method body for 'DoIt' will be added behind the method body of 'SoSomething'.
That means, that the method bodies will be in the same order, as in the the class.
I like this most.


Minor updates:
- fixed codetools define for lcl interface directory
- fixed parser: nested record case
- fixed code completion: fixed long property proc splitting
- fixed: compiling via external tools, does now reset error line
- added 'close all' menuitem
- fixed loading codetools options at start
- fixed ttreeview crash on adding root treenode
- added menu shortcuts to keymapping
- splitted keymapping in categories
- added find declaration, find block start, find other block end to search menu
- method jumping will now jump to any difference in variable or type names
- fixed code completion: will now check for redefined procs
- fixed empty line at end of code template
- added codetemplate option: indent to Token/Line start


Mattias






More information about the Lazarus mailing list