-
Notifications
You must be signed in to change notification settings - Fork 51
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
Allow model listeners on interfaces 693 #694
Allow model listeners on interfaces 693 #694
Conversation
I've verified and now a ModelListener on an Interface builds and the listener is triggered correctly. I've marked it as draft because I'm getting runtime errors (in the red error balloon in the corner) when building. Here is the stacktrace that I get. Caught exception from the listener com.mbeddr.mpsutil.modellisteners.runtime.GlobalListener@5f296354. Will continue.
java.lang.NoSuchMethodError:
'void com.mbeddr.mpsutil.modellisteners.runtime.ChildListener.<init>(
org.jetbrains.mps.openapi.language.SConcept,
org.jetbrains.mps.openapi.language.SContainmentLink)'
at org.iets3.core.expr.toplevel.listeners.ModelListenersDescriptor$1
.<init>(ModelListenersDescriptor.java:28)
at org.iets3.core.expr.toplevel.listeners.ModelListenersDescriptor
.getListeners(ModelListenersDescriptor.java:28)
at com.mbeddr.mpsutil.modellisteners.runtime.GlobalListener
.updateListeners(GlobalListener.java:113)
at com.mbeddr.mpsutil.modellisteners.runtime.GlobalListener
.onUnloaded(GlobalListener.java:82)
at jetbrains.mps.classloading.ClassLoadingBroadCaster
.onUnload(ClassLoadingBroadCaster.java:97)
at jetbrains.mps.classloading.ClassLoaderManager
.lambda$unloadModules$5(ClassLoaderManager.java:458)
at jetbrains.mps.classloading.ClassLoaderManager
.runTransaction(ClassLoaderManager.java:323)
at jetbrains.mps.classloading.ClassLoaderManager
.unloadModules(ClassLoaderManager.java:447)
at jetbrains.mps.classloading.ClassLoaderManager
.doReloadModules(ClassLoaderManager.java:551)
at jetbrains.mps.classloading.ClassLoaderManager
.reloadModules(ClassLoaderManager.java:492)
at jetbrains.mps.classloading.ClassLoaderManager
.reloadModules(ClassLoaderManager.java:580)
at jetbrains.mps.make.facets.ReloadClasses_Facet$Target_reloadClasses$1
.lambda$execute$0(ReloadClasses_Facet.java:76)
at jetbrains.mps.smodel.ActionDispatcher.dispatch(ActionDispatcher.java:99)
at jetbrains.mps.smodel.ActionDispatcher.lambda$wrap$0(ActionDispatcher.java:136)
at jetbrains.mps.smodel.LockRunnable.run(LockRunnable.java:60)
at com.intellij.openapi.application.impl.ApplicationImpl
.runReadAction(ApplicationImpl.java:839)
at jetbrains.mps.smodel.WorkbenchModelAccess
.runWriteAction(WorkbenchModelAccess.java:100)
at jetbrains.mps.smodel.ModelAccessBase.runWriteAction(ModelAccessBase.java:66)
at jetbrains.mps.make.facets.ReloadClasses_Facet$Target_reloadClasses$1
.execute(ReloadClasses_Facet.java:76)
at jetbrains.mps.internal.make.runtime.script.Script
.lambda$executeTargets$0(Script.java:309)
at jetbrains.mps.ide.make.WorkbenchMakeService$Controller
.runJobWithMonitor(WorkbenchMakeService.java:314)
at jetbrains.mps.internal.make.runtime.script.Script
.executeTargets(Script.java:254)
at jetbrains.mps.internal.make.runtime.script.Script
.execute(Script.java:232)
at jetbrains.mps.make.service.CoreMakeTask.lambda$doRun$0(CoreMakeTask.java:101)
at jetbrains.mps.make.dependencies.MakeSequence.iterate(MakeSequence.java:54)
at jetbrains.mps.make.service.CoreMakeTask.doRun(CoreMakeTask.java:75)
at jetbrains.mps.ide.make.MakeTask$WorkbenchMakeTask.doRun(MakeTask.java:148)
at jetbrains.mps.make.service.CoreMakeTask.run(CoreMakeTask.java:54)
at jetbrains.mps.ide.make.MakeTask$2.run(MakeTask.java:68)
at java.base/java.lang.Thread.run(Thread.java:829) |
I think that's fine. While unloading it already calls the newly compiled methods, that's why you get the errors. When you restart MPS everything works. |
Did you rebuild the listener aspect in the second project and also reload the project so that the listeners get unregistered and registered again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes are fine. We noticed that the existing listener descriptors don't get rebuilt even when you rebuild the full language that contains the listener aspect. You have to delete the gen folders of the language first and then the rebuilding of the descriptor will succeed.
This pull request adds the possibility to create model listeners on
InterfaceConcept
s.