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

[IDE] Update paths to resources when a container is renamed #132

Conversation

echebbi
Copy link
Collaborator

@echebbi echebbi commented May 7, 2020

Closes #70.

Changes

  • paths in both .dsl files and project preferences are updated when:
    • the enclosing project is renamed
    • a folder containing an ALE resource (source file / metamodel) is renamed
  • undo operation is supported

Demo

Click to show

demo-issue-70

Change preview

I also wanted to implement a preview of the changes (in a textual diff) but I found no code to reuse and that would thus have costed too much time. The steps are:

  1. Contribute to the org.eclipse.ltk.ui.refactoring.changePreviewViewers extension point
  2. Provide a class implementing org.eclipse.ltk.ui.refactoring.IChangePreviewViewer

Other changes

  • AleAware.getEnvironment() does not return a Normalized instance anymore. Normalized was turning each source file URI into an absolute file path, making code in Rename participants cumbersome. DslBuilder is instead charged of turning URI into files before feeding them to ANTLR.

Those details will be clean up by #123

Comments

@dvojtise I believe that the code updating the .dsl file could (and should?) be moved to the GEMOC Studio. Kind of related to eclipse-gemoc/gemoc-studio#161

@echebbi echebbi self-assigned this May 7, 2020
Because:
 - renaming a project or a container is likely to corrupt the whole ALE environment

How:
 - a RenameParticipant listens for renaming events and triggers:
    - a change that updates paths to resources in .dsl files
    - a change that updates paths to resources in project's preferences

Side changes:
 - AleAware.getEnvironment() does not return a Normalized instance anymore.
   Normalized was turning each behavior URI into an absolute file path, making
   code in Rename participants cumbersome.
   DslBuilder is instead charged of turning URI into files before feeding them to ANTLR.

Signed-off-by: Emmanuel Chebbi <emmanuel.chebbi@outlook.fr>
@echebbi echebbi force-pushed the 70-paths-to-resources-not-updated-when-the-project-is-renamed branch from de872ba to 88e299f Compare May 7, 2020 18:23
@echebbi echebbi merged commit 1543f87 into master May 7, 2020
@echebbi echebbi deleted the 70-paths-to-resources-not-updated-when-the-project-is-renamed branch May 7, 2020 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paths to resources in .dsl file not updated when the project is renamed
1 participant