Closed ehuss closed 11 years ago
Thanks for your report. I just looked over the codebase briefly, and the whole caching system is quite incoherent, mainly because it grew uncontrolled and wildly over the last months to fight performance problems ;-) Sadly, SublimeRope is just a free-time project ;-)
I do not have time today, but I'll write more when I find some time to think the whole caching thing through (e.g. why are there so many different methods and commands dealing with various caches, etc). It really needs an overall architecture.
Hi,
Not sure if you're still interested in the issue after 3 months, but I have commited a temporary fix for this issue. As you already found out, the issue was not directly with SublimeRope but with Rope and it's AutoImport contrib. It does not invalidate old cache entries on update_resource. The current fix calls some private invalidation method inside Rope. I guess there is a better way (Rope has an observer-pattern built in, which can trigger these invalidations), but they would require some general changes to SublimeRope. Noticed as TODO.
Whenever a python file is saved, rope doesn't seem to see the changes (like jump-to-global definition). Rebuilding the cache does not help. The only way to get it to update (aside from restarting Sublime) is to do something like
ropemate.project_cache.clear()
.I'm not sure how exactly Rope is supposed to see changed files. I've been tracing the code for a while, but I don't see how it is supposed to reparse a file. If you could point me to how this is supposed to work, I could try to debug it a little further. The general code path that I see is:
None of those steps seem to clear any caches.
resource_to_pyobject
just fetches thePyModule
from the cache, and fetching the attributes from that module also always gets from its cached value. Any help would be appreciated.I am on Windows, BTW.