Refactoring F2 (rename identifier) does not work with dotted identifier
- Lazarus/FPC Version: Lazarus 3.99 (rev b9d2ef8b) FPC 3.2.2 x86_64-win64-win32/win64
- Operating System: Win 7
- CPU / Bitness: 64 bit
During investigation issue What happens#40464 (closed) occurred that attempts to change dotted unit name via Refactoring / Rename Identifier (F2) does not work.
Expected: What did you expect
-
changed names of all references to chosen dotted identifier (unit name) in active project;
-
changed a name of file (*.pas) containing unit named as dotted identifier (via forced choice - (1) "Save file as ... dotted identifier" or (2) Revoke changes made by F2).
Steps to reproduce
program usedottedunit;
uses namespace1.unit1;
// Original uses section: uses namespace1.unit1;
// Expected after renaming: uses namespace2.unit1;
// look at namespace1.unit1 content
begin
WriteLn('Run OK');
ReadLn;
end.
unit namespace1.unit1;
// Rename this identifier (namespace1.unit1) via popup menu
// /Refactoring /Rename Identifier ...F2
// Update namespace1 part to namespace2 in "Find and replace" window
// setting "Search/Search Scope" option to other (!) than "in current unit"
// Press "Rename all References"
// Unit name will be changed but not in the main project file(!)
// Unit's file name remains unchanged, "Save all" Toolbar button becomes active
// there is no forced dialog to save file as "namespace2.unit1.pas" (!)
// When button "Save all" is pressed unit file is saved as "namespace2.unit1.pas"
// Unit name in the main project file is still unchanged.
//(Even so, it would be too late here).
{$mode ObjFPC}{$H+}
interface
implementation
end.