use of com.intellij.usageView.UsageInfoFactory in project intellij-community by JetBrains.
the class RenameUtil method addTextOccurrence.
private static void addTextOccurrence(final PsiElement element, final List<UsageInfo> result, final GlobalSearchScope projectScope, final String stringToSearch, final String stringToReplace) {
UsageInfoFactory factory = new UsageInfoFactory() {
@Override
public UsageInfo createUsageInfo(@NotNull PsiElement usage, int startOffset, int endOffset) {
TextRange textRange = usage.getTextRange();
int start = textRange == null ? 0 : textRange.getStartOffset();
return NonCodeUsageInfo.create(usage.getContainingFile(), start + startOffset, start + endOffset, element, stringToReplace);
}
};
TextOccurrencesUtil.addTextOccurences(element, stringToSearch, projectScope, result, factory);
}
Aggregations