From 490e26eb272499d82ac6adfbc4f2d0ca8a1913f3 Mon Sep 17 00:00:00 2001 From: Pavlo Skliar Date: Wed, 25 Jun 2025 12:25:37 +0200 Subject: [PATCH] IJPL-191319 - Fixed false positive notification about external file changes in devcontainers GitOrigin-RevId: db78440d90045a9e4a90b2a0890a0a80501640af --- .../intellij/openapi/vfs/impl/eel/EelFileWatcher.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/eel/EelFileWatcher.kt b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/eel/EelFileWatcher.kt index a629c77d2805..192e39d706eb 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/eel/EelFileWatcher.kt +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/eel/EelFileWatcher.kt @@ -46,9 +46,10 @@ class EelFileWatcher : PluggableFileWatcher() { override fun isSettingRoots(): Boolean = isOperational() && mySettingRoots.get() > 0 override fun setWatchRoots(recursive: List, flat: List, shuttingDown: Boolean) { - val recursiveFiltered = recursive.mapNotNull { it.getDevcontainerPathInfo() } - val flatFiltered = flat.mapNotNull { it.getDevcontainerPathInfo() } + val recursiveFiltered = filterAndNotifyManualWatchRoots(recursive) + val flatFiltered = filterAndNotifyManualWatchRoots(recursive) if (recursiveFiltered.isEmpty() && flatFiltered.isEmpty()) return + if (shuttingDown) { myShuttingDown = true shutdownWatcherJobs() @@ -80,6 +81,13 @@ class EelFileWatcher : PluggableFileWatcher() { } } + private fun filterAndNotifyManualWatchRoots(all: List): List { + val (result, ignored) = all.map { it to it.getDevcontainerPathInfo() }.partition { it.second != null } + myNotificationSink.notifyManualWatchRoots(this, ignored.map { it.first }) + + return result.mapNotNull { it.second } + } + private fun sortRoots( roots: List, devcontainerData: MutableMap,