eclipse-sprotty / sprotty-server

Server implementation for the Sprotty diagramming framework
https://eclipse.org/sprotty
Eclipse Public License 2.0
23 stars 19 forks source link

Allow DiagramServerManager extensions to be configured via Guice #16

Closed NiklasRentzCAU closed 5 years ago

NiklasRentzCAU commented 5 years ago

The DiagramServerManager does not follow an interface and is hard-coded to be the server manager to use within sprotty-server. I would like to extend and alter the behavior of said manager via overwriting the binding in the DefaultDiagramModule, but that only allows a binding for that specific class, as seen here: https://github.com/eclipse/sprotty-server/blob/04e45cf529cd670c58c2ddae3ce24cef8d8f8f3f/org.eclipse.sprotty.xtext/src/main/java/org/eclipse/sprotty/xtext/DefaultDiagramModule.xtend#L42

That line of code should be something like def Class<? extends IDiagramServerManager> bindIDiagramServerManager() { for some new interface to match all the other bindings of that class and allow for configuration of the diagram server manager.

NiklasRentzCAU commented 5 years ago

This issue can be closed if the pull request for it passes.

spoenemann commented 5 years ago

This issue can be closed if the pull request for it passes.

GitHub can do that automatically if you write closes #16 or fixes #16 in the pull request message or the commit message.

JanKoehnlein commented 5 years ago

Actually, the binding is in the wrong place. IDiagramServerManager is part of the DiagramLanguageServer and as such configurable in the DiagramServerModule. The DefaultDiagramModule configures a language specific diagram server, which the common DiagramLanguageServer delegates to.