-
Notifications
You must be signed in to change notification settings - Fork 57
Refactor uses of ReloadableModule #1439
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
Conversation
f09aa6d to
05d01cd
Compare
|
@wsafonov, @sergej-koscejev the change is quite straightforwad and pretty much the same in all cases, but it touches various subsystems and I don't know what would be the right approach to review it. Split, one of you, or rather subsystem author? |
|
I don't think we want to be defensive about loaded classes not being assignable to expected classes but rather fail with an error or an exception in this case. E.g. should be just |
|
@artem-tikhomirov I'm going to force-update this PR myself. |
67b6fd2 to
5cecc26
Compare
|
@artem-tikhomirov Is the result of |
5cecc26 to
d518f88
Compare
|
Changes to SelectionIntentionManager submitted as #1647. |
|
@sergej-koscejev can this PR be closed or merged? |
|
I’m working on adjusting individual commits and submitting them as separate PRs, please leave this open for now. |
d518f88 to
26646c7
Compare
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.
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.
26646c7 to
7cca17d
Compare
Address uses of classloading through ReloadableModule. Now, we keep classloading aspect of a module independent of SModule class hierarchy (and independent of any repository read/write access, too).
Uses of ReloadableModule.getOwnClass() have been refactored with ModuleRuntime.getOwnClass(). ClassLoaderManager listeners (low-level, module/repository-kind of notification), have been replaced with ModuleDeploymentListener of LanguageRegistry.