Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2021-01

question with IDE

6 messages · 6 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

duilio foschi

my IDE sometimes decides that procedure X was not coded in the implementation section of a unit...and adds an empty definition (see: https://imgur.com/awP7cK2)

The procedure is there (see https://imgur.com/6H5F2cG) but for some reason the IDE is brought to the crazy idea above.

This always happens with a couple of procedures, always the same.

Is there a way to avoid this weird behaviour?

Thank you

Peppe Polpo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20210115/5bfba739/attachment.html>

Reply by email

Pascal Riekenberg
to duilio foschi

Your existing implementation is missing the Paramter. Maybe that is the reason.

Pascal

Show quoted text 21 lines
duilio foschi via lazarus hat am 15.01.2021 13:06 geschrieben: my IDE sometimes decides that procedure X was not coded in the implementation section of a unit...and adds an empty definition (see: https://imgur.com/awP7cK2) The procedure is there (see https://imgur.com/6H5F2cG) but for some reason the IDE is brought to the crazy idea above. This always happens with a couple of procedures, always the same. Is there a way to avoid this weird behaviour? Thank you Peppe Polpo -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20210115/b0eb8cdc/attachment.html>

Reply by email

Mattias Gaertner
to duilio foschi: my IDE sometimes decides that procedure X was not coded in the implementation section of…
Show quoted text 6 lines
my IDE sometimes decides that procedure X was not coded in the implementation section of a unit...and adds an empty definition (see: https://imgur.com/awP7cK2) The procedure is there (see https://imgur.com/6H5F2cG) but for some reason the IDE is brought to the crazy idea above.

Do you have a complete example unit (you can strip the statements and vars)?
Do you use IFDEFs?

Mattias

Reply by email

Bart
to Mattias Gaertner
PM Mattias Gaertner wrote
Do you have a complete example unit (you can strip the statements and vars)?

I recently had this with fpc's deque.pp unit.
I added two methods to the intrface, then pressed Ctrl+C and it made those two, but also a new empty implementation of
TDeque.IncreaseCapacity method (which already existst). It's a generic class, if that
Bart

Reply by email

Ondrej Pokorny
to Mattias Gaertner: On Fri, 15 Jan 2021 13:06:16 +0100 Do you have a complete example unit (you can strip the…
Mattias Gaertner wrote
Do you have a complete example unit (you can strip the statements and vars)?

See the attachment for two example units - obviously I cannot guarantee it is the same scenario that duilio experiences but it is definitely an example of Ctrl+Shift+C generating a duplicate method.

In general: if you delete a method A and add a method B to the interface whereas A and B are of different types ("class constructor" vs "constructor" vs "procedure/function") you get a duplicate.

I have known about this bug for a long time but have been too lazy to fix it :(

Do you use IFDEFs?

No.

Ondrej

-------------- next part --------------
unit Unit1;
{$mode objfpc}
interface
type
  TMyClass = class
  public
    procedure DoClick(Sender: TObject);
  end;
implementation

{ TMyClass }

constructor TMyClass.Create;
begin
  inherited Create;
  Writeln('Create');
end;
end.
-------------- next part --------------
unit Unit2;
{$mode objfpc}
interface
type
  TMyClass = class
  public
    class constructor Create;
  end;
implementation

{ TMyClass }

constructor TMyClass.Create;
begin
  inherited Create;
  Writeln('Create');
end;
end.

Reply by email