Sublime text vintage8/3/2023 That said, I think this case is somehow different. Maybe package reloader should check for repeated requests to reload plugins and drop them if a prior one is still on the Thanks for that clarification! Alright, I understand now… yeah, I know what you mean by that, sometimes I’ve also experienced issues because renaming modules and globals and I wasn’t very sure what could be the exact reason, I recall some errors would go silently and mostly of the times I’d end up restarting sublime just to be sure the package errors would shown on the console properly. If a second call intercepts the import loop of a prior reload unpredictable things might happen. It’s more like a hack, which works well enough if used with care. This process takes some time and may fail if you trigger that process too quickly after each other.Īs package reloader hooks deep into pythons internals to handle the sub module reloading correctly, which was never meant by design I woudn’t call that a bug. The process of reloading a sublime text package consists of several more or less expensive tasks to ensure ST unloads existing hooks (EventListeners, Commands) and updates them after reloading the submodules is done. Sometimes the reload failed, because python tried to load something which no longer existed or some imports seemed to still point to old no longer existing modules causing failures. Same can happen after renaming (sub-)modules. Can’t recall the details, but depending on usage the old ones were still used or sometimes the code just failed because the new globals were not created. Renamed globals causes the old instances to keep alive and being used rather than the new renamed ones. I ran into issues with reloading plugins with sub modules, each time after renaming modules or globals. PS: Sometimes it takes a bit of patience to freeze sublime… another times will be a matter of few seconds (at least on my box) Īnyway, please let me know more about the edge cases you were talking about on your comment… Basically I do hate using global variables on Sublime text code but sometimes I find it specially useful when creating memory caches or using a “Singletons” across modules… It looks to me like a race condition issue and I’m not sure if the problem is because Automatic Package Reloaded is buggy… or because some of these methods. Open start.py and press save a few times without touching the code, do it as fast as possible till Sublime freezes… If you’ve have the console opened you should see eventually the line where Sublime will hang.Uncompress this foo package on Packages\foo.Install automatic package reloader and set "reload_on_save": true on settings.When you talk about this, what do you mean? Asking you cos today after spending a fair ammount of time trying to narrow a bug I’ve been able to come up with some mcve code that will consistently allow to freeze-up SublimeText 圆4 (at least build 3176), steps to do so: Especially renamed modules or global variables are problematic. But you need to know there are still some edge cases which prevent python to reload sub modules correctly sometimes.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |