Recent

Author Topic: Default section of methods in IDE Options->Code Tools->Class Completion broken?  (Read 5549 times)

soerensen3

  • Full Member
  • ***
  • Posts: 213
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
« Last Edit: June 13, 2018, 09:44:55 pm by soerensen3 »
Lazarus 1.9 with FPC 3.0.4
Target: Manjaro Linux 64 Bit (4.9.68-1-MANJARO)

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
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?
« Last Edit: June 14, 2018, 01:38:45 am by lainz »

Ondrej Pokorny

  • Full Member
  • ***
  • Posts: 220
The property handlers are not handled with this settings and AFAIK this is wanted.

Thaddy

  • Hero Member
  • *****
  • Posts: 14169
  • Probably until I exterminate Putin.
Not for public, but published.
Specialize a type, not a var.

soerensen3

  • Full Member
  • ***
  • Posts: 213
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!
Lazarus 1.9 with FPC 3.0.4
Target: Manjaro Linux 64 Bit (4.9.68-1-MANJARO)

Ondrej Pokorny

  • Full Member
  • ***
  • Posts: 220
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