A Delphi IDE plugin that detects external file modifications in real-time and automatically reloads them in the IDE.
The Delphi IDE only checks for externally modified files when it receives focus (WM_ACTIVATE). If you are working with external tools (such as AI code assistants, version control operations, or external editors) that modify project files while the IDE already has focus, those changes go undetected until you switch away and back (at which point the IDE prompts).
This plugin uses Windows ReadDirectoryChangesW via I/O Completion Ports to monitor the directories of your open projects in real-time. When a monitored file is modified externally, the plugin calls IOTAModule.Refresh to reload it automatically — no focus change required.
- Source files (.pas, .inc) — silently reloaded if the editor buffer has no unsaved changes.
- Project files (.dproj, .dpk) — silently refreshed if no unsaved changes exist.
- Files with unsaved editor changes — skipped entirely. The IDE's built-in
WM_ACTIVATEmechanism handles these with its own prompt when you next switch focus. - Files saved by the IDE itself — ignored.
Refresh(False)checks timestamps internally, so IDE-initiated saves do not trigger a redundant reload.
-
Delphi 12.x or later
-
Git (for cloning with submodules)
-
Clone the repository with submodules:
git clone --recurse-submodules https://github.com/VSoftTechnologies/VSoft.ExternalModDetector.gitIf you already cloned without submodules:
git submodule update --init --recursive -
Open
src\VSoft.ExternalModDetector.dprojin the Delphi IDE. -
Right-click the project in the Project Manager and select Build.
-
After building, right-click the
VSoft.ExternalModDetector.bplproject in the Project Manager and select Install. -
You should see a confirmation message that the package was installed.
-
The plugin is now active. Open any project and it will automatically begin monitoring the project's source directories for external changes.
-
Go to Component > Install Packages... in the Delphi IDE.
-
Select VSoft.ExternalModDetector from the list and click Remove.
The plugin logs activity to the IDE's Messages window with the prefix [ExternalModDetector]. You will see messages for:
- Directories being watched/unwatched
- Projects being scanned
- Files being refreshed or skipped
- On project open, the plugin scans all source files in the project and begins watching their directories using
IFileSystemMonitor(a wrapper aroundReadDirectoryChangesWwith I/O Completion Ports). - File change notifications are debounced (200ms) to coalesce multiple rapid notifications from a single save operation.
- On project close, the directory watches are removed. Directories shared across multiple projects are reference-counted and only unwatched when the last project using them is closed.
- During compilation, monitoring is temporarily suppressed to avoid interfering with the build process.
- FileSystemMonitor — included as a Git submodule under
FileSystemMonitor/.
See LICENSE for details.