eclipse / Xpect

This repository has been rewritten to move to the Eclipse Foundation. Find the old history here: https://github.com/TypeFox/Xpect
http://www.xpect-tests.org/
Eclipse Public License 2.0
32 stars 28 forks source link

Generated class ExecutableExtensionFactory cannot be subclassed #232

Open mmews-n4 opened 6 years ago

mmews-n4 commented 6 years ago

The javadoc comment says:

This class was generated. Customizations should only happen in a newly introduced subclass.

However, this cannot be done since somewhere in Xpect the name of the actually used ExecutableExtensionFactory is used to create another class name and load it dynamically ExtensionFactoryUtil#parseExtensionFactory(String).

Proposed solution

meysholdt commented 6 years ago

The logic from ExtensionFactoryUtil#parseExtensionFactory(String) is indeed not perfect and probably never can be. It's just a a utility to automagically setup Xpect for Xtext languages that follow standard naming conventions. If your language doesn't follow standard naming conventions, for example by introducing custom named subclasses of ExtensionFactories... you might want to use the extension point org.eclipse.xpect.fileExtensions to provide an explicit configuration for Xpect for your language.

mmews-n4 commented 6 years ago

Thanks! I didn't know that extension point.