Closed Thom1729 closed 6 years ago
The whole point of this package is to get rid of imp.reload
. Reloading just a dependency can be dangerous, we need to to make sure every module which uses the dependency will be reloaded. (I am not sure justing checking Package control dependencies are enough).
I see what you mean about imp.reload
; that wouldn't necessarily load things correctly. Instead, I'll just del
the module and let reload_package
sort it out.
“Every module which uses the dependency” should be a subset of modules in packages that declare the dependency. We'd be relying on package authors to declare dependencies correctly, but frankly if they don't then things are probably going to break anyway. Is there a better way to to it?
Under the current behavior, reloading a dependency will break packages that depend on it, so even if this approach isn't perfect I think it's a substantial improvement. If we can work out the corner cases, that would be even better.
For #12.
When the plugin tries to reload a dependency, it will:
imp.reload
all of the loaded modules within the dependency.reload_package
all of the packages that declare that dependency.After this PR, when I save a file in my local copy of
sublime_lib
, AutomaticPackageReloader reloadssublime_lib
and all packages that depend upon it.This PR does require Package Control to be installed. We can work around that if necessary, at least to a limited extent.