Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming a method results in loss of code #143

Open
therckenrath opened this issue Jan 5, 2022 · 4 comments
Open

Renaming a method results in loss of code #143

therckenrath opened this issue Jan 5, 2022 · 4 comments

Comments

@therckenrath
Copy link

Describe the bug
When you rename a method in Schema the definition in Model is completely replaced and implementation of the method disappears completely.
When the method is renamed back to its original name, the definition in Model is again completely erased and the implementation of that method is reset to the default template - the original code is gone.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Schema with a method and implement the code in the method.
  2. Rename the method in the Schema
  3. Click on the method name in Model - no method is displayed
  4. Rename the method back to its original name
  5. Click on the method name in Model - the default method template is displayed

Expected behavior
I expect the name of the method to be updated in Model and in the implementation of the method and I expect the code of the implementation to remain untouched.

Desktop (please complete the following information):

  • Crostini under Chrome OS
  • Version 96.0.4664.111 (Official Build) (64-bit)
@ecarriou
Copy link
Member

ecarriou commented Jan 5, 2022

Thanks for reporting the issue !

In fact it is a normal behavior: when renaming a method from a schema and saving, here what we do:

  1. we compare the new schema with the old one,
  2. we notice that the method name is not more there, so we remove it from the model and remove its behavior (if any)
  3. we also notice that a new method name is there, so we add it to the model

So to be able to keep the behavior, we need to be sure that we were in the case of a renaming and not of a deleting / adding. Need to check how to do that.

@therckenrath
Copy link
Author

therckenrath commented Jan 5, 2022 via email

@ecarriou
Copy link
Member

ecarriou commented Jan 7, 2022

The documentation has been updated to inform users about this behavior (see https://designfirst.io/systemdesigner/documentation/docs/en/create-a-schema.html#define-a-method) .

@therckenrath
Copy link
Author

therckenrath commented Jan 8, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants