Invoke externally-defined serializer from command handler [message #1105973] |
Tue, 10 September 2013 14:11 |
Fabian G. Messages: 60 Registered: May 2010 Location: Christchurch (NZ) |
Member |
|
|
Hi,
I have multiple languages (defined in separate plugins, lets says MyDSL1 and MyDSL2) and I would like to call the MyDSL1 serializer from the MyDSL2 plugin.
First I created a custom MyDSL1Serializer that extends the xtext serializer (almost an empty shell with a constructor calling the super constructor) and bind it from the MyDSL2UIModule with a bindMyDSL1Serializer method (effectively called at startup).
Then I tried to inject the MyDSL1Serializer in my handler (eclipse commands AbstractHandler). The injection seems to work since I retrieve the right class, but the Formatter, QualifiedNameProvider and ParseTreeConstructor referenced by this serializer are the ones from the MyDSL2 plugin, so that when the serializer tries to serialize my emf model, it just crashes because the parse tree constructor is the wrong one.
Any hint on having the serializer referencing "its" own formatter, nameprovider, etc? What am I doing wrong?
Thanks in advance,
Fabian
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03181 seconds