Overriding modules are reloaded if package is being disabled
Description of the bug
If plugins of a MyPackage.sublime-package are overriden, but the overriding package doesn't contain a .python-version file, setting "ignored_packages": ["MyPackage"] causes the overriding plugin plugin.py to be re-loaded.
folder structure:
Installed Packages
- MyPackage.sublime-package
- .python-version
- plugin.py
Packages
- MyPackage
- plugin.py
If MyPackage is ignored, .python-version is no longer visible, which causes Packages/plugin.py to switch plugin hosts (unloaded from 3.8 -> reloaded to 3.3).
If "disable_plugin_host_3.3": true is set the plugin is unloaded and reloaded by python 3.8 plugin_host.
ST actively calls sublime_plugin.reload_plugin("MyPackage.plugin") - likely related with or caused by changing .python-version visibility. FWIW, this behavior disappears, when also overriding .python-version file.
This behavior is not correct, as modules of a disabled packages shouldn't be loaded by any means - not by another plugin_host nor the same.
Steps to reproduce
- add a MyPackage.sublime-package file containing a .python-version and an empty plugin.py to Data/Installed Packages.
- add an empty Data/Packages/MyPackage/plugin.py
- Start vanilla ST
- set
"ignored_packages": ["MyPackage", "Vintage"] - check console output
Expected behavior
Console:
ignored packages updated to: ["MyPackage", "Vintage"]
reloading settings Packages/MyPackage/MyPackage.sublime-settings
unloading plugin MyPackage.plugin
Modules from Packages/ shouldn't be reloaded if associated Installed Packages/MyPackage.sublime-package is being unmounted.
Actual behavior
Console ("disable_plugin_host_3.3": false):
ignored packages updated to: ["MyPackage", "Vintage"]
unloading plugin MyPackage.plugin
reloading python 3.3 plugin MyPackage.plugin
reloading settings Packages/User/Preferences.sublime-settings
Console ("disable_plugin_host_3.3": true):
ignored packages updated to: ["MyPackage", "Vintage"]
unloading plugin MyPackage.plugin
reloading plugin MyPackage.plugin
reloading settings Packages/User/Preferences.sublime-settings
Sublime Text build number
4200
Operating system & version
Windows 11
(Linux) Desktop environment and/or window manager
No response
Additional information
No response
OpenGL context information
Since it was mentioned that there will only be one plugin host moving forward, I suspect that this issue will kind of resolve itself by then.
Not by removing a plugin host. It also happens for overriding modules in Packages/ if corresponding *.sublime-package file is disabled.