From d02a8d0c1b1f6350be8abf96f678e7f80f95ad19 Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Sat, 12 Mar 2016 23:15:58 +0300 Subject: [PATCH] show "Current File" scope always (WEB-20644) --- .../psi/search/PredefinedSearchScopeProviderImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/psi/search/PredefinedSearchScopeProviderImpl.java b/platform/lang-impl/src/com/intellij/psi/search/PredefinedSearchScopeProviderImpl.java index 9f32bbc32655..c8282195e3be 100644 --- a/platform/lang-impl/src/com/intellij/psi/search/PredefinedSearchScopeProviderImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/search/PredefinedSearchScopeProviderImpl.java @@ -101,10 +101,12 @@ 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) { -- 2.23.3