Renaming file and updating references scrambles file interface when using periods in filenames
- Lazarus/FPC Version: Lazarus 2.3.0 (rev main-2_3-3677-gf7ab7582) FPC 3.3.1 i386-win32-win32/win64
- Operating System: Windows 11 Pro 22H2 build 22621.1415
- CPU / Bitness: 64 Bit
What happens
If I try to rename files that have periods in them, and let the IDE update all references, units referencing them will damage their uses section and following stuff.
What did you expect
Renaming to work as with files without periods.
Steps to reproduce
- Create a new project (project1.lpr, unit1.pas).
- Add another unit (Unit2.pas) to project.
- Add
Unit2
touses
ofUnit1
. - Save project and units.
- Switch to
Unit2
, save asUnit2.foobar
. - Allow it to delete old file.
- Allow it to update references.
- As another bug note that
Unit1
will still point toUnit2
, notUnit2.foobar
.
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Unit2;
type
TForm1 = class(TForm)
private
- Switch to
Unit2.foobar
, save asUnit3
. - Allow it to delete old file.
- Allow it to update references.
- Check Unit1:
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Unit3pe
TForm1 = class(TForm)
private
As you can see, the update of reference here has removed a following part of the uses
section, even up to the type
definition.
Reproducible, happens very often to me since I use a lot of periods in filenames.
Edited by CCRDude