[Lazarus] question with IDE

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] question with IDE

Free Pascal - Lazarus mailing list
my IDE sometimes decides that procedure X was not coded in the implementation section of a unit...and adds an empty definition

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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] question with IDE

Free Pascal - Lazarus mailing list
Your existing implementation is missing the Paramter. Maybe that is the reason.


Pascal

duilio foschi via lazarus <[hidden email]> 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

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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] question with IDE

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Fri, 15 Jan 2021 13:06:16 +0100
duilio foschi via lazarus <[hidden email]> wrote:

> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] question with IDE

Free Pascal - Lazarus mailing list
On Fri, Jan 15, 2021 at 1:34 PM Mattias Gaertner via lazarus
<[hidden email]> 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 matters at all.


--
Bart
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] question with IDE

Free Pascal - Lazarus mailing list
On 15/01/2021 16:51, Bart via lazarus wrote:
> 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 matters at all.

Just for reference:
A similar report exists here:
https://forum.lazarus.freepascal.org/index.php/topic,47593.0.html
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] question with IDE

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 15.01.2021 13:34, Mattias Gaertner via lazarus 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


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

Unit1.pas (364 bytes) Download Attachment
Unit2.pas (348 bytes) Download Attachment