From 33584e367163bc3ffe39228faa06b57de28ff3b4 Mon Sep 17 00:00:00 2001 From: Lev Leontev Date: Tue, 20 May 2025 14:43:04 +0200 Subject: [PATCH] BAZEL-2044: make dummy modules have InternalModuleType and hide them in the UI Related: IDEA-372530 and BAZEL-969 GitOrigin-RevId: 47aa52378ae3da93229bbf05862c8c0c200a303c --- .../refactoring/util/RefactoringConflictsUtilImpl.java | 3 ++- .../com/intellij/openapi/vcs/impl/ModuleVcsPathPresenter.java | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/java/java-impl-refactorings/src/com/intellij/refactoring/util/RefactoringConflictsUtilImpl.java b/java/java-impl-refactorings/src/com/intellij/refactoring/util/RefactoringConflictsUtilImpl.java index e4936608b95e..8872cd09fe8d 100644 --- a/java/java-impl-refactorings/src/com/intellij/refactoring/util/RefactoringConflictsUtilImpl.java +++ b/java/java-impl-refactorings/src/com/intellij/refactoring/util/RefactoringConflictsUtilImpl.java @@ -3,6 +3,7 @@ package com.intellij.refactoring.util; import com.intellij.java.refactoring.JavaRefactoringBundle; import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleType; import com.intellij.openapi.module.ModuleUtilCore; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; @@ -252,7 +253,7 @@ public final class RefactoringConflictsUtilImpl implements RefactoringConflictsU } final Module targetModule = ModuleUtilCore.findModuleForFile(vFile, project); - if (targetModule == null) return; + if (targetModule == null || ModuleType.isInternal(targetModule)) return; final GlobalSearchScope resolveScope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(targetModule); final HashSet reported = new HashSet<>(); Consumer processor = new Consumer<>() { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ModuleVcsPathPresenter.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ModuleVcsPathPresenter.java index de0c6e8fda9b..922f65369de1 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ModuleVcsPathPresenter.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ModuleVcsPathPresenter.java @@ -4,6 +4,7 @@ package com.intellij.openapi.vcs.impl; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleType; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ProjectFileIndex; import com.intellij.openapi.roots.ProjectRootManager; @@ -73,6 +74,8 @@ public class ModuleVcsPathPresenter extends VcsPathPresenter { if (relativePath != null) return FileUtilRt.toSystemDependentName(relativePath); //NON-NLS } + if (ModuleType.isInternal(fromModule)) return null; + VirtualFile fromContentRoot = fileIndex.getContentRootForFile(fromParent, hideExcludedFiles); if (fromContentRoot == null) return null;