JetBrains / MPS-extensions

MPS-extensions aims to ease language development within MPS.
https://jetbrains.github.io/MPS-extensions/
Apache License 2.0
83 stars 52 forks source link

projectview: "Tree is not set" exception when rebuilding plugin solution #628

Closed ajoanni closed 9 months ago

ajoanni commented 1 year ago

Hello community, I have a situation where I frequently get the following exception in the IDE Capture_Exception

and, additionally, that one Capture_Exception_Core

I am using MPS 2021.3.2 and mbeddr platform version 2021.3.23831. It should be noted that the custom project view works as expected. However, the first kind of exception typically occurs when I expand the custom tree and select one of the leaves and, afterwards, rebuild the plugin solution that contains the project view description.

The problem may be somehow related to the specific overall project that contains the plugin solution (actually, it is two open projects at a time), because the problem still persists when I create - within this project - a bare plugin solution that only contains an example project view description that only references a dummy language with single node concept. It does, however, not persist when I create an isolated small project that only contains the bare plugin solution plus the dummy language.

As a side note, it might be helpful to know that I get many Tree is not set exceptions in the console when I set load children lazy = false in the project view description, similar to

Exception in thread "pool-7-thread-83" Exception in thread "pool-7-thread-82" Exception in thread "pool-7-thread-81" Exception in thread "pool-7-thread-80" Exception in thread "pool-7-thread-79" Exception in thread "pool-7-thread-78" Exception in thread "pool-7-thread-77" Exception in thread "pool-7-thread-76" Exception in thread "pool-7-thread-75" Exception in thread "pool-7-thread-74" Exception in thread "pool-7-thread-73" Exception in thread "pool-7-thread-72" Exception in thread "pool-7-thread-71" Exception in thread "pool-7-thread-70" java.lang.RuntimeException: Tree is not set at com.mbeddr.mpsutil.projectview.runtime.tree.CustomTreeNode.getTree(CustomTreeNode.java:67) at com.mbeddr.mpsutil.projectview.runtime.tree.CustomTreeNode.getTree(CustomTreeNode.java:31) at jetbrains.mps.ide.ui.tree.MPSTreeNode.getTree(MPSTreeNode.java:110) at com.mbeddr.mpsutil.projectview.runtime.tree.CustomTreeNode.getTree(CustomTreeNode.java:65) at com.mbeddr.mpsutil.projectview.runtime.tree.CustomTreeNode.getTree(CustomTreeNode.java:31) at jetbrains.mps.ide.ui.tree.MPSTreeNode.getTree(MPSTreeNode.java:110) at com.mbeddr.mpsutil.projectview.runtime.tree.CustomTreeNode.getTree(CustomTreeNode.java:65) at com.mbeddr.mpsutil.projectview.runtime.tree.CustomTreeNode.getTree(CustomTreeNode.java:31) at jetbrains.mps.ide.ui.tree.MPSTreeNode.getTree(MPSTreeNode.java:110) at com.mbeddr.mpsutil.projectview.runtime.tree.CustomTreeNode.getTree(CustomTreeNode.java:65) at com.mbeddr.mpsutil.projectview.runtime.tree.CustomTreeNode.getTree(CustomTreeNode.java:31) at com.mbeddr.mpsutil.projectview.runtime.tree.highlighter.TreeUpdateVisitor$1.run(TreeUpdateVisitor.java:46) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

Many thanks, Andreas

alexanderpann commented 9 months ago

I've disabled throwing this exception in https://github.com/JetBrains/MPS-extensions/pull/762, I don't know why this was necessary. I'll close the issue but please reopen it if there are still issues that need to be fixed.