Skip to content

Use language-specific option for metamodel loading when using emf-model language#2845

Draft
tsaglam wants to merge 9 commits intodevelopfrom
feature/emf-language-options
Draft

Use language-specific option for metamodel loading when using emf-model language#2845
tsaglam wants to merge 9 commits intodevelopfrom
feature/emf-language-options

Conversation

@tsaglam
Copy link
Copy Markdown
Member

@tsaglam tsaglam commented Mar 1, 2026

This PR replaces the clunky order-based mechanism to ensure metamodel files are loaded before parsing model files. This is done by introducing a language-specific option, which allows specifying one or more paths to .ecore files. As a consequence, the emf-model language no longer requires a submission order. As this is the only language that uses this feature, we can remove it. The corresponding methods in the Language interface are marked as deprecated.

Partly solves #576.

Work in progress, tasks left to do:

  • Add more unit tests, especially regarding the metamodel path option.
  • Adapt readme to show how to specify metamodel files.
  • Test if the language-specific option works with the jar.
  • Decide if the methods in the Language interface should be removed now (only possible if next release is a major one).

For release notes:
TODO

@tsaglam tsaglam added enhancement Issue/PR that involves features, improvements and other changes minor Minor issue/feature/contribution/change language PR / Issue deals (partly) with new and/or existing languages for JPlag question A question, so neither a bug nor a enhancement proposal. labels Mar 1, 2026
@tsaglam tsaglam requested a review from Copilot March 1, 2026 15:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the prior submission-order-based metamodel loading mechanism for the emf-model language with a language-specific option that allows explicitly specifying .ecore metamodel path(s). As a result, core no longer supports language-controlled submission reordering / ordered parsing, and the relevant Language interface methods are deprecated.

Changes:

  • Add metamodel language option for emf-model to load/register one or more .ecore metamodel files.
  • Remove the submission order customization mechanism from core parsing/building and from EmfModelLanguage.
  • Adjust EMF model parsing behavior to warn/skip .ecore files found in submissions and update unit test resources accordingly.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
languages/emf-model/src/test/resources/de/jplag/bookStore.ecore Adds a test metamodel resource used via the new metamodel-path option.
languages/emf-model/src/test/java/de/jplag/emf/model/MinimalModelInstanceTest.java Updates EMF model instance test to set the metamodel option instead of relying on submission order.
languages/emf-model/src/main/java/de/jplag/emf/model/parser/DynamicModelParser.java Stops implicitly loading metamodels from submission files; warns instead.
languages/emf-model/src/main/java/de/jplag/emf/model/MetamodelPathOption.java Introduces new option that parses/registers metamodel(s) from provided path(s).
languages/emf-model/src/main/java/de/jplag/emf/model/EmfModelLanguage.java Removes submission ordering hooks and exposes EmfLanguageOptions via getOptions().
languages/emf-model/src/main/java/de/jplag/emf/model/EmfLanguageOptions.java Adds options container for emf-model language (registers the new metamodel option).
language-api/src/main/java/de/jplag/options/LanguageOptions.java Adds addOption(...) helper for registering custom LanguageOption implementations.
language-api/src/main/java/de/jplag/Language.java Deprecates the submission-order-related extension points.
core/src/main/java/de/jplag/SubmissionSetBuilder.java Removes submission-set reordering based on language submission order customization.
core/src/main/java/de/jplag/SubmissionSet.java Always parses submissions in parallel (removes conditional sequential parsing path).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 2, 2026

@tsaglam tsaglam removed the question A question, so neither a bug nor a enhancement proposal. label Mar 19, 2026
@tsaglam
Copy link
Copy Markdown
Member Author

tsaglam commented Mar 21, 2026

@robinmaisch, this PR deprecates a few methods of the public API. Is the next release set to be a major one? I could either remove these methods directly or just deprecate them for now. Any preferences?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Issue/PR that involves features, improvements and other changes language PR / Issue deals (partly) with new and/or existing languages for JPlag minor Minor issue/feature/contribution/change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants