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

GLSP-974: Use interface-injection for all subclasses of ModelState #199

Merged
merged 5 commits into from
Apr 17, 2023

Conversation

CamilleLetavernier
Copy link
Member

  • Use interfaces for EMFModelState and EMFNotationModelState
  • Use these interfaces for binding and injection

refs eclipse-glsp/glsp#974

@planger
Copy link
Member

planger commented Apr 12, 2023

Nice! Maybe is eclipse-glsp/glsp#896 or is/could be addressed in this go?

@CamilleLetavernier
Copy link
Member Author

Maybe is eclipse-glsp/glsp#896 or is/could be addressed in this go?

I'll take a look 👍

@CamilleLetavernier
Copy link
Member Author

I believe this is fixed by this PR, as we now bind the class only once. Extra bindings only specify additional interface-bindings for the same class. However I'm not really sure how to test it. Is there an example where I could try it?

@planger
Copy link
Member

planger commented Apr 12, 2023

I believe this is fixed by this PR, as we now bind the class only once. Extra bindings only specify additional interface-bindings for the same class.

That's what I also was thinking looking at the code.

However I'm not really sure how to test it. Is there an example where I could try it?

Well, I think it should be sufficient if you'd remove the override of bindGModelState() in your subclass of EMFDiagramModule. The use case was basically having a concrete DiagramModule that extends EMFDiagramModule but uses the EMFModelState instead of explicitly binding a specialization of EMFModelState.

- Make sure a single instance of the ModelState will be used, regardless
of which (sub-)type is used for injecting it

refs eclipse-glsp/glsp#974
Copy link
Contributor

@ndoschek ndoschek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @CamilleLetavernier!
Changes look great to me, I did not really test it, but it will be easier to test it with the already opened PR in the modelserver-glsp-integration.

Besides that I only have a few very minor comments, mostly regarding the year ranges in the file headers.

- Also remove accidental debug statements

refs eclipse-glsp/glsp#974
Copy link
Contributor

@ndoschek ndoschek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CamilleLetavernier for the updates! LGTM 👍

- Update Changelog to describe the changes to GModelState
dependency-injection

refs eclipse-glsp/glsp#974
@CamilleLetavernier
Copy link
Member Author

Commit a0350bf updates the Changelog for 2.x, as this PR includes breaking changes related to EMFModelState and EMFNotationModelState

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.

None yet

4 participants