EiffelStudio 23.09 issue with refactoring (class rename)

Skip to first unread message


Apr 17, 2024, 9:58:46 AMApr 17
to eiffelstudio-dev
There is an issue with refactoring (in particular with undo of a class rename) in EiffelStudio 23.09. I tested with Windows and Linux, but the following description is mainly for Windows. On Linux the behaviour is a little bit different and I haven't investigated it in detail.

Given is a simple project with these two classes:


description: "test_project application root class"
date: "$Date$"
revision: "$Revision$"




feature {NONE} -- Initialization

-- Run application.
--| Add your code here
print ("Hello Eiffel World!%N")
create test_class

test_class: TEST_CLASS_1



description: "Summary description for {TEST_CLASS_1}."
author: ""
date: "$Date$"
revision: "$Revision$"



Steps to reproduce:

1. Compile this project, open editor with class TEST_CLASS_1 and have it the active editor tab.

2. Select menu "Refactor" / "Rename" and enter "TEST_CLASS_2" as the new name. Select options "Compiled Classes", "Rename File", "Replace Name in Comments" and "Replace Name in Strings". "All Classes" and "Reuse existing name" are not selected. Click "OK".

3. Class is renamed (including the file) and the editor is correctly updated (during, I think) the compilation process. Also note that the name of the class in the editor tab changed. Also the EiffelStudio window title changed correctly and the class name has been updated in the Groups tool. So no issue here on Windows. On Linux the editor is also updated correctly but I get a warning VD80 regarding a configuration error that is related to the changed file name (but as said, I haven't investigated this in detail).

4. Now, select menu "Refactor" / "Undo Refactoring" and click "OK" in the popup "EiffelStudio Question".

5. The class rename has correctly been undone, but: The editor still "wants" to display class TEST_CLASS_2 (because it doesn't exist anymore it displays text "File: some_path\test_class_2.e does not exist.") and the window title also has not changed. In the Groups tool the class has been updated to its original name TEST_CLASS_1 correctly and clicking on it finally updates the editor to display TEST_CLASS_1.

I digged into the implementation of the refactoring and it seems that something is done differently during undo and redo of a class rename refactoring. Even after spending quite some time debugging this, I still haven't found the root cause for this. It seems that the class object of type EIFFEL_CLASS_I has a different state. Even adding changing its name (feature set_name) during undo behaves different than changing its name during the initial rename and doesn't solve the issue.

If someone could give me some details or point me to what could be wrong I am willing to do some more investigation and try to fix this. But at the moment I'm simply stuck with this and would finally create a support report for Eiffel Software.

Any thoughts?


Jocelyn Fiat

Apr 17, 2024, 12:15:49 PMApr 17
to eiffelstudio-dev
Hi Thomas,

I would need to dig into the code to find out why.
As this is not a critical error (job is done, only UI display), I will not investigate that right now.
But I keep that on my TODO list (but without high priority)
Reply all
Reply to author
0 new messages