Navigation: Use local search scope for top-level properties in script
#KT-20465 Fixed
This commit is contained in:
@@ -141,6 +141,12 @@ abstract class KtNamedDeclarationStub<T extends KotlinStubWithFqName<?>> extends
|
|||||||
return new LocalSearchScope(enclosingBlock);
|
return new LocalSearchScope(enclosingBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PsiElement parent = getParent();
|
||||||
|
PsiElement grandParent = parent != null ? parent.getParent() : null;
|
||||||
|
if (parent instanceof KtBlockExpression && grandParent instanceof KtScript) {
|
||||||
|
return new LocalSearchScope(getContainingFile());
|
||||||
|
}
|
||||||
|
|
||||||
if (hasModifier(KtTokens.PRIVATE_KEYWORD)) {
|
if (hasModifier(KtTokens.PRIVATE_KEYWORD)) {
|
||||||
KtElement containingClass = PsiTreeUtil.getParentOfType(this, KtClassOrObject.class);
|
KtElement containingClass = PsiTreeUtil.getParentOfType(this, KtClassOrObject.class);
|
||||||
if (containingClass instanceof KtObjectDeclaration && ((KtObjectDeclaration) containingClass).isCompanion()) {
|
if (containingClass instanceof KtObjectDeclaration && ((KtObjectDeclaration) containingClass).isCompanion()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user