Closed sermoz closed 5 years ago
👍 this uses case is quite common. I suspect you don't exactly experience any noticable slow down through this, considering it only queries up to maybe 100 folders and only happens on demand.
@FichteFoll generally there shouldn't be any performance-related problems. The only doubt I have is the "reload on save" feature. If it's on, every .py file is checked with relative_to_spp
on each save.
Just created 100 "fake" symlinks in the SPP and measured the time spent in relative_to_spp
: it's less than 2ms for me. It's not visible to a human. I think we shouldn't worry about that.
I have merged a similar PR but later reverted it because it was bugged in some way. (I remember there was an issue if the whole Packages
directory is symlinked.) I would take a more conservative approach this time and would merge it after sufficient testing.
It's legal to have folder symlinks immediately inside the Sublime package path (SPP):
SPP/symlink -> ~/A/B/C
Sublime will happily load everything under
~/A/B/C/
as ordinary package contents. It's often convenient to arrange things like this because oftentimes you don't want to put the code your working on directly under~/.config/sublime-text-3/Packages/
but still want things to get automatically loaded into Sublime.Now the problem is when you open a Python module from
~/A/B/C/
, the Automatic Package Reloader won't recognize it as a relevant file and won't reload the respective package's modules. This pull request remedies that by scanning all folder symlinks under SPP and trying to match the given path against the links' destinations.