Lazarus

Using the Lazarus IDE => Options => Topic started by: soerensen3 on June 13, 2018, 09:42:48 pm

Title: Default section of methods in IDE Options->Code Tools->Class Completion broken?
Post by: soerensen3 on June 13, 2018, 09:42:48 pm
The setting "IDE Options->Code Tools->Class Completion->Default section of methods" does not seem to have an effect for me. If I use for example protected and complete the following code it will still create a private section.

Code: Pascal  [Select][+][-]
  1. type
  2.   TTestClass = class
  3.   //you get this on completion
  4.   //private
  5.   //  FTest: Integer;
  6.   //  procedure SetTest( AValue: Integer );
  7.   public
  8.     property Test: Integer read FTest write SetTest; // <- Ctrl + Shift + C here
  9.   end;
  10.  
I know it says "methods" not fields but it does not work for either of them for me. Can anyone confirm this?
Lazarus Version 1.8.2
Title: Re: Default section of methods in IDE Options->Code Tools->Class Completion broken?
Post by: lainz on June 14, 2018, 01:28:40 am
Confirmed on Lazarus trunk svn 58089.

And for both, properties you write on the public section, and methods you write in the implementation section.

Edit: but it works fine for 'OnShow' and that kind of methods created with the Object Inspector. Maybe you can fill a feature request?
Title: Re: Default section of methods in IDE Options->Code Tools->Class Completion broken?
Post by: Ondrej Pokorny on June 14, 2018, 11:01:22 am
The property handlers are not handled with this settings and AFAIK this is wanted.
Title: Re: Default section of methods in IDE Options->Code Tools->Class Completion broken?
Post by: Thaddy on June 14, 2018, 12:17:57 pm
Not for public, but published.
Title: Re: Default section of methods in IDE Options->Code Tools->Class Completion broken?
Post by: soerensen3 on June 14, 2018, 06:13:16 pm
Thanks for your answers.
Confirmed on Lazarus trunk svn 58089.

And for both, properties you write on the public section, and methods you write in the implementation section.

Edit: but it works fine for 'OnShow' and that kind of methods created with the Object Inspector. Maybe you can fill a feature request?
Oh I didn't know you can use code completion for creating methods. That makes a lot of things easier.
However from the object inspector (Double clicking a method) it does not work with the section which makes no sense to me.

The property handlers are not handled with this settings and AFAIK this is wanted.
Why is this wanted? Wouldn't it make sense to have one setting for both properties and methods (including getters and setters of properties) or at least two (Which I don't see any point in, but maybe someone else does).

Not for public, but published.
Do you mean if I replace the public with published in the above sample it works for you? For me it doesn't!
Title: Re: Default section of methods in IDE Options->Code Tools->Class Completion broken?
Post by: Ondrej Pokorny on June 15, 2018, 06:45:15 am
The property handlers are not handled with this settings and AFAIK this is wanted.
Why is this wanted?

You may want to create property handlers in a different section than event handlers. But maybe I am wrong and this can really be handled with just one settings.

Wouldn't it make sense to have one setting for both properties and methods (including getters and setters of properties) or at least two (Which I don't see any point in, but maybe someone else does).

Feel free to improve this. Lazarus is a community project after all.
TinyPortal © 2005-2018