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

Generated class ExecutableExtensionFactory cannot be subclassed #232

Open
mmews-n4 opened this issue Apr 27, 2018 · 2 comments
Open

Generated class ExecutableExtensionFactory cannot be subclassed #232

mmews-n4 opened this issue Apr 27, 2018 · 2 comments
Labels

Comments

@mmews-n4
Copy link

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

  • Make the generated class final and adjust the comment, or
  • improve the logic of ExtensionFactoryUtil#parseExtensionFactory(String)
@mmews-n4 mmews-n4 added the bug label Apr 27, 2018
@meysholdt
Copy link
Contributor

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
Copy link
Author

mmews-n4 commented May 2, 2018

Thanks! I didn't know that extension point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants