Renaming module

Hello i've found a weard behavior after renaming a module. For demonstration purposes i've prepared a small example.

I created a new project with the following languages: 

(Hint: 'language1' depends on 'language.base')

Now i want to rename the "rename.module.language.base" module to "rename.module.language.basics". To achieve this i've used the following method:

 

Step 1) Rename "rename.module.language.base" module to "rename.module.language.basics" via "Logical View" view

Step 2) Rename "rename.module.language.base" folder to "rename.module.language.basics" via "File System" view

(Before)

(After)

 

Step 3) Replace old "rename.module.language.base" from "modules.xml" with "rename.module.language.basics" (Alt + Enter on project)

 

Step 4) Deleting the empty "rename.module.language.base" folder via system explorer (optional)

 

Step 5) Rebuild of the entire project.

 

Problem:

It seems like everything went right, but when i check any ".mpl"/".msd" file of a module, that depends on the previous renamed module, the name of its dependency version (and language versions) is not up to date.

(Dependency itself is fine)

(Dependency versions is NOT)

It is possible to change the displayed name of the dependency version manually, but this takes a lot of time ('trial and error') if the renamed module is something fundamental, because you have to find all references (language/dependeny versions) AND hope that MPS doesn't readjusts the dependencies to older versions.

 

Is there any best practise in renaming modules so that other projects do not suffer from migration issues?

 

Thank you in advance and best regards

2 comments
Comment actions Permalink

First of all, modules and languages in mps are identified by ids, so name can be considered as a kind of additional human-readable information mostly for debug purposes. MPS tries to update names everywhere in module and model files, but if somewhere name stays untouched it should not affect any of functionality.

Not changing names inside dependencyVersions and languageVersions tags during rename refactoring is definitely a bug. So if you already have your languages renamed, I recommend you not to worry about unchanged names in those places and wait for 2017.3.3 release coming soon. When you open your project in MPS 2017.3.3 you can run 'Re-save all models from project' action to update names in the whole project.

The same action is nessesary to update names if you perform language rename in 2017.3.3. After renaming language you should:

  1. Make renamed languages
  2. Restart MPS (this step will be unnecessary in future major releases)
  3. Run 'Re-save all models from project' action
1
Comment actions Permalink

@Mihail Buryakov

Thanks for your advice

0

Please sign in to leave a comment.