diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/BundleNameEvaluator.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/BundleNameEvaluator.java index 923a48b9c928..c0adcb777dee 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/BundleNameEvaluator.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/BundleNameEvaluator.java @@ -43,6 +43,13 @@ public interface BundleNameEvaluator { } }; + BundleNameEvaluator BASE_NAME = new BundleNameEvaluator() { + @Nullable + public String evaluateBundleName(final PsiFile psiFile) { + return ResourceBundleManager.getInstance(psiFile.getProject()).getBaseName(psiFile); + } + }; + @Nullable String evaluateBundleName(PsiFile psiFile); } diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesCopyHandler.java b/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesCopyHandler.java index 592f1c99ba9c..5137a2ab111a 100644 --- a/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesCopyHandler.java +++ b/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesCopyHandler.java @@ -42,7 +42,7 @@ import com.intellij.psi.PsiFileSystemItem; import com.intellij.psi.PsiManager; import com.intellij.psi.impl.SyntheticFileSystemItem; import com.intellij.psi.search.GlobalSearchScope; -import com.intellij.psi.search.GlobalSearchScopesCore; +import com.intellij.psi.search.ProjectScope; import com.intellij.psi.search.PsiElementProcessor; import com.intellij.refactoring.copy.CopyHandlerDelegateBase; import com.intellij.ui.ComboboxSpeedSearch; @@ -238,7 +238,7 @@ public class PropertiesCopyHandler extends CopyHandlerDelegateBase { final Collection propertiesFiles = new ArrayList<>(); - GlobalSearchScope searchScope = GlobalSearchScopesCore.projectProductionScope(myProject).union(GlobalSearchScopesCore.projectTestScope(myProject)); + GlobalSearchScope searchScope = ProjectScope.getContentScope(myProject); PropertiesReferenceManager .getInstance(myProject) .processPropertiesFiles(searchScope, @@ -248,7 +248,7 @@ public class PropertiesCopyHandler extends CopyHandlerDelegateBase { propertiesFiles.add(propertiesFile); return true; } - }, BundleNameEvaluator.DEFAULT); + }, BundleNameEvaluator.BASE_NAME); final List resourceBundlesAsFileSystemItems = propertiesFiles .stream()