Error after updating the MPS-Core plugin

Hi,

we are using mps as intellij plugin. For this we use the mps-core plugin (version 3.3) and extended the class FilePerRootDataSource to be able to open our schemas by override the method getFile.

But now we updated to the latest version of the plugins (2017.3) and this class is final, so we cannot extend. So I changed to FolderDataSource but give me the following error

java.lang.IllegalArgumentException: Argument for @NotNull parameter 'virtualFile' of com/intellij/psi/impl/file/impl/FileManagerImpl.setViewProvider must not be null
at com.intellij.psi.impl.file.impl.FileManagerImpl.$$$reportNull$$$0(FileManagerImpl.java)
at com.intellij.psi.impl.file.impl.FileManagerImpl.setViewProvider(FileManagerImpl.java)
at jetbrains.mps.idea.core.psi.impl.MPSPsiModel.reload(MPSPsiModel.java:389)
at jetbrains.mps.idea.core.psi.impl.MPSPsiProvider$2$1.reload(MPSPsiProvider.java:256)
at jetbrains.mps.idea.core.psi.impl.events.SModelEventProcessor.processAffected(SModelEventProcessor.java:65)
at jetbrains.mps.idea.core.psi.impl.events.SModelEventProcessor.process(SModelEventProcessor.java:52)
at jetbrains.mps.idea.core.psi.impl.MPSPsiProvider$1.lambda$eventsHappenedInCommand$0(MPSPsiProvider.java:99)
at jetbrains.mps.idea.core.psi.impl.MPSPsiProvider$1.eventsHappenedInCommand(MPSPsiProvider.java:102)
at jetbrains.mps.smodel.GlobalSModelEventsManager$MyEventsCollector.eventsHappened(GlobalSModelEventsManager.java:134)
at jetbrains.mps.smodel.ModelsEventsCollector.lambda$flush$0(ModelsEventsCollector.java:93)
at jetbrains.mps.smodel.WorkbenchModelAccess.runWriteAction(WorkbenchModelAccess.java:97)
at jetbrains.mps.smodel.ModelsEventsCollector.flush(ModelsEventsCollector.java:93)
at jetbrains.mps.smodel.ModelsEventsCollector$MyCommandAdapter.commandFinished(ModelsEventsCollector.java:141)
at jetbrains.mps.smodel.WorkbenchModelAccess.onCommandFinished(WorkbenchModelAccess.java:408)
at jetbrains.mps.smodel.WorkbenchModelAccess.decCommandLevel(WorkbenchModelAccess.java:365)
at jetbrains.mps.smodel.WorkbenchModelAccess.access$200(WorkbenchModelAccess.java:49)
at jetbrains.mps.smodel.WorkbenchModelAccess$CommandRunnable.lambda$run$0(WorkbenchModelAccess.java:451)
at jetbrains.mps.smodel.WorkbenchModelAccess.runWriteAction(WorkbenchModelAccess.java:97)
at jetbrains.mps.smodel.WorkbenchModelAccess$CommandRunnable.run(WorkbenchModelAccess.java:446)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:149)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:109)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at jetbrains.mps.smodel.WorkbenchModelAccess.runWriteActionInCommand(WorkbenchModelAccess.java:311)
at jetbrains.mps.smodel.WorkbenchModelAccess.executeCommand(WorkbenchModelAccess.java:307)
at jetbrains.mps.project.ProjectModelAccess.executeCommand(ProjectModelAccess.java:43)
at pt.i2s.ibml.navigation.I2SNavigationSupport.openRootNode(I2SNavigationSupport.java:46)
at pt.i2s.ibml.actions.IbmlActions.lambda$openRulesetInternal$4(IbmlActions.java:98)
at jetbrains.mps.smodel.WorkbenchModelAccess.lambda$tryWrite$6(WorkbenchModelAccess.java:199)
at jetbrains.mps.util.ComputeRunnable.compute(ComputeRunnable.java:32)
at jetbrains.mps.util.AbstractComputeRunnable.run(AbstractComputeRunnable.java:27)
at jetbrains.mps.smodel.WriteActionDispatcher.run(WriteActionDispatcher.java:39)
at jetbrains.mps.smodel.WriteActionDispatcher.compute(WriteActionDispatcher.java:49)
at jetbrains.mps.smodel.WorkbenchModelAccess.lambda$tryWrite$7(WorkbenchModelAccess.java:218)
at jetbrains.mps.util.ComputeRunnable.compute(ComputeRunnable.java:32)
at jetbrains.mps.util.AbstractComputeRunnable.run(AbstractComputeRunnable.java:27)
at jetbrains.mps.smodel.TryRunPlatformWriteHelper$TryWriteActionRunnable.lambda$tryWrite$0(TryRunPlatformWriteHelper.java:142)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1004)
at jetbrains.mps.smodel.TryRunPlatformWriteHelper$TryWriteActionRunnable.tryWrite(TryRunPlatformWriteHelper.java:140)
at jetbrains.mps.smodel.TryRunPlatformWriteHelper.tryWrite(TryRunPlatformWriteHelper.java:121)
at jetbrains.mps.smodel.WorkbenchModelAccess.tryWrite(WorkbenchModelAccess.java:236)
at jetbrains.mps.smodel.WorkbenchModelAccess.tryWrite(WorkbenchModelAccess.java:202)
at jetbrains.mps.smodel.WorkbenchModelAccess.lambda$runWriteInEDT$3(WorkbenchModelAccess.java:151)
at jetbrains.mps.smodel.EDTExecutorInternal.tryToRunTopTask(EDTExecutorInternal.java:204)
at jetbrains.mps.smodel.EDTExecutorInternal.flushNTasks(EDTExecutorInternal.java:167)
at jetbrains.mps.smodel.EDTExecutorInternal.doFlush(EDTExecutorInternal.java:141)
at jetbrains.mps.smodel.EDTExecutorInternal.flushTasksQueue(EDTExecutorInternal.java:129)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:111)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:120)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransactionLater$4(TransactionGuardImpl.java:271)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2018-06-26 08:28:31,387 [ 167817] INFO - terceptor.LoggingInInterceptor - Inbound Message

 

When I try to open on of my schemas because of 

MPSProject component = project.getComponent(MPSProject.class);
ModelAccess modelAccess = component.getRepository().getModelAccess();
modelAccess.executeCommand


The problem is in MPSPsiModel reload method that is initializing the MPSPsiRootNode without mySeparateFile (virtual file). Before the update I could extend from FilePerRootDataSource so MPSPsiRootNode could be initialize with virtual file, but now I cannot.

 

How can I do this?

 

 

Thanks

1 comment
Comment actions Permalink

Hi Artur!

I really would like you to describe your scenario in more detail. This is very interesting. Since you say 'for opening our schemas', I can think you are implementing your own model persistence.

I think extending FilePerRootDataSource might have been too low level anyways. Let's figure out the proper way together.

Also, is it intensional you're switching to 2017.3 as the latest version? Because the latest release is 2018.1 now, and 2018.2 is right around the corner.

 

1

Please sign in to leave a comment.