Renaming a unit does not update its references in other units
Original Reporter info from Mantis: JuhaManninen @JuhaManninen
-
Reporter name: Juha Manninen
Original Reporter info from Mantis: JuhaManninen @JuhaManninen
- Reporter name: Juha Manninen
Description:
Renaming a unit with "File -> Save As ..." its unit name is changed correctly.
Its references in other units should be updated after asking from user but it does not happen.
It has worked sometimes. I remember seeing a question :
'The unit %s is used by other files.'
'Update references automatically?';
function ReplaceUnitUse() in unit SourceFileManager has code for it.
It seems that a Codetools function
GatherUnitReferences(Files,OldCode,false,IgnoreErrors,true,PascalReferences);
raises an exception internally and does not return a unit list as it should.
Steps to reproduce:
Open the attached project and rename the HelperUnit. It is used by the MainUnit but the reference is not updated.
Additional information:
I went almost 3 years back in revision history. The feature does not work even there.
I have seen it working however. Is there another way to rename a unit so that it works?
Any information?
I tested with Linux 64-bit but this does not depend on platform.
Mantis conversion info:
- Mantis ID: 38559
- Build: Latest
- Version: 2.1 (SVN)
- Fixed in revision: 64704 (#341a3f7a).