From b73a104b9156a84427efcbb6397676e712e01329 Mon Sep 17 00:00:00 2001 From: Artem Tikhomirov Date: Wed, 25 Jun 2025 18:33:06 +0300 Subject: [PATCH 1/2] grammarcells.DescriptorCache: use ModuleRuntime to manage instances CLM+ReloadableModule is way too low-level runtime management mechanism, which drags repository access. Use modern ModuleRuntime instead DeployListener in AppPlugin updated to remove code that checked for the current module being unloaded. This code would never be invoked. --- .../mbeddr/mpsutil/grammarcells/runtime.mps | 577 ++++++++++-------- .../mpsutil/grammarcells/runtime/plugin.mps | 121 +--- 2 files changed, 345 insertions(+), 353 deletions(-) diff --git a/code/grammarcells/solutions/com.mbeddr.mpsutil.grammarcells.runtime/models/com/mbeddr/mpsutil/grammarcells/runtime.mps b/code/grammarcells/solutions/com.mbeddr.mpsutil.grammarcells.runtime/models/com/mbeddr/mpsutil/grammarcells/runtime.mps index 23037dba60..0400983bc3 100644 --- a/code/grammarcells/solutions/com.mbeddr.mpsutil.grammarcells.runtime/models/com/mbeddr/mpsutil/grammarcells/runtime.mps +++ b/code/grammarcells/solutions/com.mbeddr.mpsutil.grammarcells.runtime/models/com/mbeddr/mpsutil/grammarcells/runtime.mps @@ -69,10 +69,13 @@ + + + + - @@ -295,6 +298,7 @@ + @@ -31247,25 +31251,18 @@ - + - + - - - - - - - - + @@ -31274,10 +31271,18 @@ - + + + + + + + + + @@ -31294,47 +31299,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -31352,9 +31395,9 @@ - + - + @@ -31363,89 +31406,41 @@ - - - - - - - - - + + + - - - + + + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -31453,34 +31448,34 @@ - - - - - - - - - - - - - - - - - - + + + + - - - + + + + + + + + + + + + + + + + + @@ -31526,58 +31521,51 @@ - - - - - - - - - - - - - - - - - + + + + + - + + + + - - - - - + + + + + + - - + + - - + + + - - - + + + @@ -31586,8 +31574,50 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31601,121 +31631,162 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + + - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + - - - - - + + + - - - - - - - - diff --git a/code/grammarcells/solutions/com.mbeddr.mpsutil.grammarcells.runtime/models/com/mbeddr/mpsutil/grammarcells/runtime/plugin.mps b/code/grammarcells/solutions/com.mbeddr.mpsutil.grammarcells.runtime/models/com/mbeddr/mpsutil/grammarcells/runtime/plugin.mps index 0fe7691065..39aa9a7330 100644 --- a/code/grammarcells/solutions/com.mbeddr.mpsutil.grammarcells.runtime/models/com/mbeddr/mpsutil/grammarcells/runtime/plugin.mps +++ b/code/grammarcells/solutions/com.mbeddr.mpsutil.grammarcells.runtime/models/com/mbeddr/mpsutil/grammarcells/runtime/plugin.mps @@ -32,6 +32,7 @@ + @@ -75,6 +76,7 @@ + @@ -448,22 +450,14 @@ - - - - - - - - - - - + + + + + + - - - @@ -610,92 +604,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -742,6 +650,19 @@ + + + + + + + + + + + + + From 7cca17da0569dd33e6317f852c433704c11524e2 Mon Sep 17 00:00:00 2001 From: Artem Tikhomirov Date: Tue, 10 Jun 2025 11:31:55 +0300 Subject: [PATCH 2/2] ProjectView: replace ReloadableModule w/ ModuleRuntime Besides, no need for unload hack to see if the module has been unloaded. Now, MPS PluginManager is client of LanguageRegistry, like the code in ProjectViewManager, and load/unload notifications would get in proper order together with plugin app part events. Before, mixing CLM code (notifications immediately on module injection into repo) with PluginManager code (notified with delay from LanguageRegistry) indeed lead to an improper class dispose ordering. --- ...com.mbeddr.mpsutil.projectview.runtime.msd | 1 + .../mbeddr/mpsutil/projectview/runtime.mps | 940 ++++++++---------- .../mpsutil/projectview/runtime/plugin.mps | 3 + 3 files changed, 421 insertions(+), 523 deletions(-) diff --git a/code/projectview/com.mbeddr.mpsutil.projectview.runtime/com.mbeddr.mpsutil.projectview.runtime.msd b/code/projectview/com.mbeddr.mpsutil.projectview.runtime/com.mbeddr.mpsutil.projectview.runtime.msd index ab1eda42bd..0a812ea8ea 100644 --- a/code/projectview/com.mbeddr.mpsutil.projectview.runtime/com.mbeddr.mpsutil.projectview.runtime.msd +++ b/code/projectview/com.mbeddr.mpsutil.projectview.runtime/com.mbeddr.mpsutil.projectview.runtime.msd @@ -34,6 +34,7 @@ + diff --git a/code/projectview/com.mbeddr.mpsutil.projectview.runtime/models/com/mbeddr/mpsutil/projectview/runtime.mps b/code/projectview/com.mbeddr.mpsutil.projectview.runtime/models/com/mbeddr/mpsutil/projectview/runtime.mps index a55a042e6e..72bde56192 100644 --- a/code/projectview/com.mbeddr.mpsutil.projectview.runtime/models/com/mbeddr/mpsutil/projectview/runtime.mps +++ b/code/projectview/com.mbeddr.mpsutil.projectview.runtime/models/com/mbeddr/mpsutil/projectview/runtime.mps @@ -7,6 +7,7 @@ + @@ -15,9 +16,7 @@ - - @@ -26,13 +25,12 @@ - - - + + @@ -79,12 +77,17 @@ - + + + + + + @@ -92,10 +95,6 @@ - - - - @@ -116,6 +115,9 @@ + + + @@ -188,6 +190,7 @@ + @@ -231,6 +234,9 @@ + + + @@ -250,15 +256,11 @@ - - - - - - - - - + + + + + @@ -6180,351 +6182,122 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - @@ -6572,21 +6345,9 @@ - - - - - - - - - - - - - - - + + + @@ -7391,75 +7152,204 @@ - - - - - + + + + + - - - - + + + - - + + + + + - - - - - - - - - - - - + + + + + + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7470,14 +7360,8 @@ - - - - - - - - + + @@ -7500,6 +7384,24 @@ + + + + + + + + + + + + + + + + + + @@ -7508,30 +7410,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - @@ -7549,11 +7444,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7566,63 +7501,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - + + + - + - - + + @@ -7705,7 +7599,7 @@ - + @@ -7751,7 +7645,7 @@ - + @@ -7813,11 +7707,16 @@ - - + + + + + + + - + @@ -7842,26 +7741,24 @@ - - - - - - - - - - - - + + + + - - - - + + + + + + + + + + @@ -7873,7 +7770,7 @@ - + @@ -7939,7 +7836,7 @@ - + @@ -8043,9 +7940,6 @@ - - - diff --git a/code/projectview/com.mbeddr.mpsutil.projectview.runtime/models/com/mbeddr/mpsutil/projectview/runtime/plugin.mps b/code/projectview/com.mbeddr.mpsutil.projectview.runtime/models/com/mbeddr/mpsutil/projectview/runtime/plugin.mps index c9311d3711..d22b354d8f 100644 --- a/code/projectview/com.mbeddr.mpsutil.projectview.runtime/models/com/mbeddr/mpsutil/projectview/runtime/plugin.mps +++ b/code/projectview/com.mbeddr.mpsutil.projectview.runtime/models/com/mbeddr/mpsutil/projectview/runtime/plugin.mps @@ -27,6 +27,7 @@ + @@ -105,6 +106,7 @@ + @@ -120,6 +122,7 @@ +