https://github.com/kapitanluffy/sublime-file-watcher
Adds support to broadcasting file events to Sublime Text
https://github.com/kapitanluffy/sublime-file-watcher
Last synced: about 2 months ago
JSON representation
Adds support to broadcasting file events to Sublime Text
- Host: GitHub
- URL: https://github.com/kapitanluffy/sublime-file-watcher
- Owner: kapitanluffy
- License: mit
- Created: 2024-02-13T16:20:46.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-24T01:42:24.000Z (about 1 year ago)
- Last Synced: 2025-02-07T03:25:04.851Z (3 months ago)
- Language: Python
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 👁 File Watcher
Sublime Text unfortunately does not automatically detect changes in the loaded folders.
This package adds support to it by leveraging `LSP` features and broadcasting an event where other packages can subscribe## Requirements:
This package requires [LSP](https://packagecontrol.io/packages/LSP) and [`LSP-file-watcher-chokidar`](https://packagecontrol.io/packages/LSP-file-watcher-chokidar)
## Usage:
Create an event listener inside your package subscribing to `file_watcher_broadcast_event`
```py
import sublime
import sublime_pluginclass MyFileEventListener(sublime_plugin.EventListener):
def on_window_command(self, window: sublime.Window, command_name: str, args):
if command_name != "file_watcher_broadcast_event":
return# _events is an array of tuples `(event, file)[]`
# "event" can be create, change or delete
events = args['_events']# do something...
```