randy3k / AutomaticPackageReloader

Automatically reload submodules while developing a Sublime Text package.
MIT License
38 stars 13 forks source link

Use of installing/removing dummy module? #45

Closed deathaxe closed 10 months ago

deathaxe commented 11 months ago

I don't see the sense of installing or removing a dummy module to trigger something related to reloading a specific package.

To correctly reload all top-level plugins of a specific package, it just needs to be added to ignored_packages temporarily, so ST unloads all plugins and then loads them again, when being removed from ignored_packages again.

Various plugins just delete all sub-packages and modules from sys.modules when reloading a single main top-level plugin to enforce reloading sub-modules (and load new ones) in correct order.

Otherwise manually iterating through the list of top-level plugins and reload them with the "ReloadingImporter" should IMHO be enough.

deathaxe commented 10 months ago

Answered at https://github.com/randy3k/AutomaticPackageReloader/pull/50#issuecomment-1882515676