revert "show "Current File" scope always (WEB-20644)" (following IDEA-CR-9242)
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Mon, 14 Mar 2016 11:14:45 +0000 (14:14 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Mon, 14 Mar 2016 11:14:45 +0000 (14:14 +0300)
platform/lang-impl/src/com/intellij/psi/search/PredefinedSearchScopeProviderImpl.java

index c8282195e3be1b4201b2a2a8681fdb0dbfedb0eb..9f32bbc326552f9e17dceb8c5e40dbe88ce26ec2 100644 (file)
@@ -101,12 +101,10 @@ public class PredefinedSearchScopeProviderImpl extends PredefinedSearchScopeProv
             result.add(module.getModuleScope());
           }
         }
+        if (dataContextElement.getContainingFile() != null) {
+          result.add(new LocalSearchScope(dataContextElement, IdeBundle.message("scope.current.file")));
+        }
       }
-      PsiElement[] currentFileScope = PsiElement.EMPTY_ARRAY;
-      if (dataContextElement != null && dataContextElement.getContainingFile() != null) {
-        currentFileScope = new PsiElement[]{dataContextElement};
-      }
-      result.add(new LocalSearchScope(currentFileScope, IdeBundle.message("scope.current.file")));
     }
 
     if (currentSelection) {