SearchScope () { if (!isPhysical()) { final PsiFile file = getContainingFile(); final PsiElement context = file.getContext(); if (context != null) return new LocalSearchScope(context); return super.getUseScope(); } final PsiElement scope = getDeclarationScope(); if (scope instanceof GrDocCommentOwner owner) { final GrDocComment comment = owner.getDocComment(); if (comment != null) { return new LocalSearchScope(new PsiElement[]{scope, comment}); } } return new LocalSearchScope(scope); }