Juha Manninen wrote 17 lines
On Wed, May 7, 2025 at 8:37?PM Timothy Groves via lazarus <
> wrote:
> Especially considering that it adds them named as
> 'unit1', et cetera, and as soon as you change the name of the unit -
> which you *will* do - it throws an error.
How to reproduce the error?
Here the name is changed in the project source file and in other units
using it.
The first time I get a dialog which tells the unit is used elsewhere and
offers to update the uses sections. I always select "Change all" or
similar. (I don't have the dialog open now)
If the error is caused by that dialog, IMO it should be removed completely.
Renamed units must be updated in uses sections *always*. I don't see any
reason to ask about it.
There is:
I often rename a unit to make a duplicate to experiment with changes. In that case, the original unit must not be removed and all units must keep the old name in their uses clause. So the question is useful.
Beside this use case, I think it is good practice to point out to the user the consequences of an action. He may change his mind.
VS code 'automagically' does a lot of things and gets it wrong a little too often to my taste. Lazarus has a relatively good track record in this regard, so let us not spoil that.
If you really want to get rid of the question, make it a setting somewhere.
Michael.