#2190 closed enhancement (fixed)
Rename / Copy features missing in OMEdit
Reported by: | Francesco Casella | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | New Instantiation | Version: | trunk |
Keywords: | Cc: | m.ceraolo@…, Adrian Pop, Per Östlund, Adeel Asghar, dersh@… |
Description
A typical development pattern in Modelica is that one starts from an existing class (e.g., from the MSL, or from one's own package), makes a copy of it, then starts modifying it. In older releases of OMEdit (e.g., r14547), one could right-click on the model icon and select Copy (though this was not possible in the MSL, for some reason), but the feature didn't work correctly and was later removed.
It would be highly recommended to have it back in OMEdit, because it can save a lot of time when developing system models.
Also the Rename feature was available in the same context menu, even though it crashed OMC (see #2001 and #2116). It was later removed, but it would be good to have it back, it would be very bad if users needed to carry out this task manually on their library.
Note that both functions require refactoring the type names in the declarations, if the new/renamed class is in a different package. This might require implementing new API functions.
Change History (15)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → accepted |
This is not really an issue for OMEdit, is mostly for the front-end (Interactive and instantiation).
comment:3 by , 12 years ago
Component: | OMEdit → New Instantiation |
---|
comment:5 by , 12 years ago
Cc: | added |
---|
As a temporary solution, it would already be good if OMEdit allowed to copy or rename classes within the same package, which needs no dependency fixes. I guess this can be implemented easily.
When refactoring becomes available from the front end, cross-package copy/rename could also be added to OMEdit easily.
comment:6 by , 11 years ago
Milestone: | Future → 1.9.1 |
---|
comment:7 by , 11 years ago
Milestone: | 1.9.1 → 1.9.2 |
---|
comment:8 by , 11 years ago
Cc: | added |
---|
comment:9 by , 10 years ago
In r23234 I have added a new copyClass
API. It doesn't check any dependencies. The API should work fine for copying within the same package. However, the API does provide interface for copying the class to another package but the results might be wrong if the copied class has relative components.
comment:10 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:14 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
A Copy feature has been implemented in OMEdit long time ago. I have opened a new ticket (#3915) for the Rename feature
The problem with rename is that we had some functionality which did this at the source code level (Absyn) but you don't really have enough information there to rename everything properly. You need to do dependency analysis and some sort of partial instantiation to find out what uses what.
I agree that this is highly needed and we should have it in mind for the new instantiation because you need to somehow feed that information back to the source code so you can do these kind of things (and not only this, conditional components and redeclares are needed too).