From ced16698e8dc79d97829331c493bc7d6ca78a20e Mon Sep 17 00:00:00 2001 From: Liudmila Kornilova Date: Thu, 28 Aug 2025 16:45:11 +0200 Subject: [PATCH] Don't include containing directory into the children file count GitOrigin-RevId: ce73105e38e9df50d970d29e456d25e03a2dda41 --- .../projectView/impl/ProjectViewInplaceCommentProducerImpl.kt | 1 + .../src/com/intellij/internal/CountVfsFileChildrenAction.kt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewInplaceCommentProducerImpl.kt b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewInplaceCommentProducerImpl.kt index 710a0f478a8f..8977d9ba8349 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewInplaceCommentProducerImpl.kt +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewInplaceCommentProducerImpl.kt @@ -84,6 +84,7 @@ internal fun appendVfsInfo(node: ProjectViewNode<*>, appender: InplaceCommentApp count++ count < showCachedChildrenLimit } + count-- // don't count the directory itself val countString = if (count <= showCachedChildrenLimit) count.toString() else "$count+" appender.append(" $countString VFS ${if (count == 1) "file" else "files"}", SimpleTextAttributes.GRAYED_SMALL_ATTRIBUTES) } diff --git a/platform/lang-impl/src/com/intellij/internal/CountVfsFileChildrenAction.kt b/platform/lang-impl/src/com/intellij/internal/CountVfsFileChildrenAction.kt index 10f1ef5bf49b..d6bf7b1f25d4 100644 --- a/platform/lang-impl/src/com/intellij/internal/CountVfsFileChildrenAction.kt +++ b/platform/lang-impl/src/com/intellij/internal/CountVfsFileChildrenAction.kt @@ -49,6 +49,7 @@ internal class CountVfsFileChildrenAction : AnAction(), DumbAware { return true } }) + filesOnDiskCount-- // don't count the directory itself val message = "Under ${root.path}
" + "there are $filesOnDiskCount files on disk" Notification("System Messages", message, NotificationType.INFORMATION) @@ -75,6 +76,7 @@ internal class CountVfsFileChildrenAction : AnAction(), DumbAware { } true } + vfsFilesCount-- // don't count the directory itself val message = "Under ${root.path}
" + "there are $vfsFilesCount files in VFS:
" + "$contentFilesCount content files
" +