An IntelliJ IDEA plugin that watches files in the background and triggers "Synchronize All From Disk" and build when changes are detected.
- Watches files in the background: Monitors your project directory for file changes using Java's WatchService API
- Configurable Filters: Fine-tune which files trigger reloads
- Check if file is in source
- Check if file is in test source
- Check if file is in generated source
- Check if file is in project content
- Regex Path Filters: Define custom regex patterns to match specific file paths
- Auto Reload: Automatically triggers "Synchronize All From Disk" when changes are detected
- Auto Rebuild: Automatically triggers project build after synchronization
- Debouncing: Actions run once changes have been quiet for the configured delay (default: 500ms)
- Event Tracking: Tool window showing:
- Processed events/ignored events with timestamps and matched rules
- Project-Level Settings: Each project has its own independent configuration stored in
.idea/workspace.xml
Requires IntelliJ IDEA 2023.3 (build 233) or newer. No upper bound is declared, so the plugin keeps working on future IDE releases instead of being disabled when a new major version ships.
To build the plugin, you need:
- JDK 17 or later
- Gradle (or use the Gradle wrapper if configured)
Build the plugin:
./gradlew buildPluginThe built plugin will be in build/distributions/.
Check binary compatibility against every supported IDE release:
./gradlew verifyPlugin- Build the plugin as described above
- In IntelliJ IDEA, go to
Settings/Preferences→Plugins - Click the gear icon and select
Install Plugin from Disk... - Select the ZIP file from
build/distributions/ - Restart IntelliJ IDEA
To test the plugin in a sandboxed IntelliJ IDEA instance:
./gradlew runIderunIde uses the compatibility floor (2023.3). To smoke-test on a newer IDE, and optionally open
a project straight away:
./gradlew runIdeOn -PideVersion=2026.1.5 -PideProject=/path/to/some/project- When a project is opened,
ProjectOpenListenerstarts theFileWatcherServiceif watching was enabled for that project - The service takes a snapshot of the module roots (source, test source, content, excluded) and derives the directories to watch from it and from the settings
- One
RecursiveDirectoryWatcherper project subscribes those directories with a singleWatchServiceand a single thread; the deepest matching root or exclusion decides, so a generated source root inside an excludedbuilddirectory is still watched - Directories that get created are subscribed on the fly, directories that disappear are unsubscribed; when the project structure or the settings change only the directories whose membership changed are touched
- Every event is classified against the cached roots and the compiled regex filters, then logged to the tool window
- Events that pass the filters (re)arm the debounce timer; the actions run once the changes have been quiet for the configured delay
- The reload refreshes the VFS from disk, and the build is started only after that refresh has finished
Configure filtering, regex patterns, and auto-reload behavior in the plugin settings:
Track file changes and see which rules matched in real-time:
Navigate to Settings/Preferences → Tools → Background File Watcher to configure:
-
File Filtering Options:
- Check is in source
- Check is in test source
- Check is in generated source
- Check is in project content
-
Regex Path Filters:
- Define custom regex patterns (one per line)
- Define ignore file patter regex
- Patterns are validated on save
-
Auto Actions:
- Enable/disable automatic reload from disk
- Enable/disable automatic project rebuild
-
Debounce Delay:
- Configure delay in milliseconds (default: 500ms)
The plugin adds a "File Watcher" tool window at the bottom of the IDE:
- Processed Events: Shows files that triggered reload/rebuild with matched rules and timestamps so that you can adjust your regex to meet your demands
This plugin is particularly useful when:
- Files are being modified by external tools or processes
- You're using code generators that modify source files
- You're syncing files from external sources
- You need immediate feedback when files change outside the IDE
Check the IntelliJ IDEA log for messages from the plugin:
Help→Show Log in Finder/Explorer
The plugin logs what it starts, subscribes, ignores and triggers under the com.radut.plugin.bfw loggers. Enable debug logging for that package in Help → Diagnostic Tools → Debug Log Settings to also see ignored events and individual directory subscriptions.
If you find this plugin useful, please consider supporting its development:
Your support helps maintain and improve this plugin!
This project is licensed under the MIT License - see the LICENSE file for details.

