-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notify when a file/folder is created/changes/reloads/disapears, even if not opened #626
Comments
My real World example is that I need to check the content of a file when a new view/tab is loaded. I need to open/read and parse that file every-time a file is opened, not good! |
You could compare against the file's modified date instead as that will be quicker than reading and comparing the entire file. It might be less reliable but definitely quicker and easier on the storage. I'd flag this as a feature request not an enhancement as such a feature does not exist for plugins so far and we don't know how ST watches its package files. |
I was about to file this exact issue. The ST Floobits plugin adds support for real time collaboration for every file in the project - not just the opened views (in order for builds to work on both sides). Frequently, files are edited outside of ST which causes us quite a bit of trouble. ST already indexes the files and watches them. Reimplementing file scanning ourselves would be quite a bit of work and a poor user experience. Scanning eats up both disk IO and CPU; moreover, its async so our plugins view and ST's view would be ... out of sync. ST should expose the file events via the Listener API. IntelliJ exposes both types of events and offers a good example of how to do it. All file-like objects are exposed via VirtualFiles; the files can map to files on disk, objects in a zipped bundle, or remote files. Users edit Documents (ST Views) which are backed by VirtualFiles. VirtualFiles can be saved, moved, deleted, written, reloaded, etc. |
I was looking for a solution to the same problem.
To use it, create a folder with any name under under Data\Packages and place the .py file in that folder. |
This looks like a duplicate of #2669 |
#2669 is about resource files. This issue is about files in a project. |
Would be very nice to add an API call/event for when a file or folder changes that includes all events: creation/modification/deletion. This for example will allow to fire things when something changes, as re-parsing a file or something. Currently we need to crawl the complete tree in intervals, I guess this is something ST already does..
The text was updated successfully, but these errors were encountered: