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

Stop adding every Ecore metamodel to ALE's execution environment #151

Closed
echebbi opened this issue Jun 26, 2020 · 1 comment · Fixed by #168
Closed

Stop adding every Ecore metamodel to ALE's execution environment #151

echebbi opened this issue Jun 26, 2020 · 1 comment · Fixed by #168
Assignees

Comments

@echebbi
Copy link
Collaborator

echebbi commented Jun 26, 2020

Motivation

Currently, each EClass from every EPackage installed in the IDE in project's dependencies is made available to the interpreter and to the validators through AQL's IQueryEnvironment. This causes a lot of issues, especially when opening a class that exists both in user's metamodel and in some other metamodel:

// Can cause issues because State is also an EEnum 
// in the EPackage "http://eclipse.org/eclipse/gemoc/dsl/debug"
open class State {

}

Combined to #149 it makes the editing very unfriendly.

Investigation

Culprits seem to be calls to AQL's JavaExtensionManager::reloadIfNeeded. It may make sense in AQL's context to fetch every metamodel but it doesn't in ours.

This method is called by the AleInterpreter here and here.

Proposition

First, make sure we understand what this method does and why we call it. Then, investigate one of the following

  • remove calls to this method,
  • replace current calls with calls to a custom method,
  • replace JavaExtensionsManager with a custom class.
@echebbi
Copy link
Collaborator Author

echebbi commented Jun 29, 2020

After digging a bit into the code I actually found a way easier solution.

The JavaExtensionManager internally uses a BundleClassLoading to discover available EPackages and Java services. Fortunately, the JavaExtensionManager::setClassLoadingOverride setter allows to provide a custom ClassLoader.

The ClassLoading interface is API and should allow us to easily tailor the EPackages and Java services we want to make available.

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

Successfully merging a pull request may close this issue.

1 participant