@NotNull @Override public SearchScope getUseScope() { if (this instanceof GoVarDefinition || this instanceof GoConstDefinition || this instanceof GoLabelDefinition) { GoBlock block = PsiTreeUtil.getParentOfType(this, GoBlock.class); if (block != null) return new LocalSearchScope(block); } if (!isPublic()) { return GoPackageUtil.packageScope(getContainingFile()); } GoSpecType parentType = PsiTreeUtil.getStubOrPsiParentOfType(this, GoSpecType.class); if (parentType != null) { GoTypeSpec typeSpec = GoPsiImplUtil.getTypeSpecSafe(parentType); if (typeSpec != null && !StringUtil.isCapitalized(typeSpec.getName())) { return GoPackageUtil.packageScope(getContainingFile()); } } return GoUtil.goPathUseScope(this, !(this instanceof GoMethodDeclaration)); }
@NotNull @Override public SearchScope getUseScope() { return new LocalSearchScope(getContainingFile()); }
@NotNull @Override public SearchScope getUseScope() { return new LocalSearchScope(getContainingFile()); }
@NotNull @Override public SearchScope getUseScope() { return new LocalSearchScope(getContainingFile()); } }
@NotNull @Override public SearchScope getUseScope() { return new LocalSearchScope(getContainingFile()); }
@NotNull @Override public SearchScope getUseScope() { return new LocalSearchScope(getContainingFile()); }
@NotNull @Override public SearchScope getUseScope() { if (isLexicalDeclaration()) { PerlLexicalScope lexicalScope = getVariable().getLexicalScope(); if (lexicalScope != null) { return new LocalSearchScope(lexicalScope); } } return super.getUseScope(); }
final FindUsagesHandler findUsagesHandler = findUsagesManager.getFindUsagesHandler(target, true); final LocalSearchScope scope = new LocalSearchScope(psiElement); Collection<PsiReference> refs = findUsagesHandler != null ? findUsagesHandler.findReferencesToHighlight(target,
TargetElementUtil.getInstance().getNamedElement(myElement, myAdjustedOffset - myElement.getNode().getStartOffset()); if (namedElement != null) { PsiReference reference = ReferencesSearch.search(namedElement, new LocalSearchScope(myFile)).findFirst(); if (reference instanceof PsiPolyVariantReference) { List<PsiElement> result = new ArrayList<>();
@Override public void computeUsages(List<PsiElement> targets) { if (targets == null) { return; } for (PsiElement target : targets) { if (myFile.equals(target.getContainingFile()) && target instanceof PsiNameIdentifierOwner) { PsiElement nameIdentifier = ((PsiNameIdentifierOwner)target).getNameIdentifier(); if (nameIdentifier != null) { TextRange rangeInIdentifier = target instanceof PerlIdentifierRangeProvider ? ((PerlIdentifierRangeProvider)target).getRangeInIdentifier() : ElementManipulators.getValueTextRange(nameIdentifier); myWriteUsages.add(rangeInIdentifier.shiftRight(nameIdentifier.getNode().getStartOffset())); } } for (PsiReference reference : ReferencesSearch.search(target, new LocalSearchScope(myFile)).findAll()) { myReadUsages.add(reference.getRangeInElement().shiftRight(reference.getElement().getNode().getStartOffset())); } } } }
.first(); if (state != null) { SearchScope scope = queryParameters.getEffectiveSearchScope().intersectWith(new LocalSearchScope(file)); queryParameters.getOptimizer().searchWord(state.getName(), scope, true, state); .find(o -> name.equals(o.getName())); if (field != null) { SearchScope scope = queryParameters.getEffectiveSearchScope().intersectWith(new LocalSearchScope(javaFile)); queryParameters.getOptimizer().searchWord(name, scope, true, field);