fix(gui): fix rename package behaviors#2500
Conversation
| renameField.setText(node.getName()); | ||
| if (node instanceof JRenamePackage) { | ||
| JRenamePackage renamePackage = (JRenamePackage) node; | ||
| renameField.setText(renamePackage.getTitle()); |
There was a problem hiding this comment.
Well, if you want to see full name instead short name in editor box, you can just change "name" to "fullName" in JRenamePackage.getName() method.
But, short name used here intentionally, because detecting changed part in full name is much harder. It is unclear if the middle package name was renamed or rest moved into a new package. Also, packages count can change and that complicate things even more.
I am actually implemented a full package rename, but it is just safer and easier to rename only one part.
I will also look into this issue, maybe I will be able to find a root cause.
There was a problem hiding this comment.
I will also look into this issue, maybe I will be able to find a root cause.
I thik here root cuase or it not bug(?) on pt 2
|
I checked current code, and have only bad news 🤣 :
Here "synthetic package" is a package created by user during moving a class to a new package, such package doesn't have a “reference” so it can't be saved with current approach. It is possible to use other nodes as references, I will create a new issue for that. For now, I just disable rename for such packages 😭 Second issue: while your change is fixed tree refresh for simple renames, looks like structural changes to tree still not applied after moving class to different package (I suspect some caching issue). So original #1590 issue still not fixed. |
Related to #1590 (comment)