public static SearchMatch[] removeGenerated(SearchMatch[] returnValue) { List<SearchMatch> result = new ArrayList<SearchMatch>(); for (int j = 0; j < returnValue.length; j++) { SearchMatch searchResult = returnValue[j]; if (searchResult.getElement() instanceof IField) { IField field = (IField) searchResult.getElement(); // can not check for value=lombok because annotation is // not fully resolved IAnnotation annotation = field.getAnnotation("Generated"); if (annotation != null) { // Method generated at field location, skip continue; } } result.add(searchResult); } return result.toArray(new SearchMatch[result.size()]); }
public void indexDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) { try { searchDocument.setIndex(index); searchParticipant.indexDocument(searchDocument, indexLocation); } finally { searchDocument.setIndex(null); } } public void indexResolvedDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) {
/** * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch) */ public void acceptSearchMatch(SearchMatch match) throws CoreException { this.resultCollector.accept( match.getResource(), match.getOffset(), match.getOffset() + match.getLength(), (IJavaElement) match.getElement(), match.getAccuracy() ); } /**
SearchPattern pattern = SearchPattern.createPattern(fTarget.getDeclaringType() .getFullyQualifiedName() + "." + fTarget.getElementName(), type, IJavaSearchConstants.REFERENCES, SearchPattern.R_PREFIX_MATCH | SearchPattern.R_ERASURE_MATCH); SearchEngine engine = new SearchEngine(); engine.search(pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, scope, new SearchRequestor() { @Override public void acceptSearchMatch(SearchMatch match) throws CoreException { if (match.getAccuracy() == SearchMatch.A_ACCURATE && !match.isInsideDocComment()) { invocations.add(match); } } }, new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
public void indexDocument(SearchDocument document, IPath indexPath) { if (!(document instanceof JavaSearchDocumentDelegate)) return; // use Java search indexing SearchEngine.getDefaultSearchParticipant().indexDocument(document, indexPath); }
private TypeReference(IJavaElement enclosingElement, int accuracy, int start, int length, boolean insideDocComment, IResource resource, int simpleNameStart, String simpleName) { super(enclosingElement, accuracy, start, length, insideDocComment, SearchEngine.getDefaultSearchParticipant(), resource); fSimpleNameStart= simpleNameStart; fSimpleTypeName= simpleName; }
@Override public String toString() { return "searching " + this.pattern.toString(); //$NON-NLS-1$ } }
/** * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch) */ public void acceptSearchMatch(SearchMatch match) throws CoreException { this.resultCollector.accept( match.getResource(), match.getOffset(), match.getOffset() + match.getLength(), (IJavaElement) match.getElement(), match.getAccuracy() ); } /**
public void indexDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) { try { searchDocument.setIndex(index); searchParticipant.indexDocument(searchDocument, indexLocation); } finally { searchDocument.setIndex(null); } } public void indexResolvedDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) {
/** * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch) */ public void acceptSearchMatch(SearchMatch match) throws CoreException { this.resultCollector.accept( match.getResource(), match.getOffset(), match.getOffset() + match.getLength(), (IJavaElement) match.getElement(), match.getAccuracy() ); } /**
public void indexDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) { try { searchDocument.setIndex(index); searchParticipant.indexDocument(searchDocument, indexLocation); } finally { searchDocument.setIndex(null); } } /**
/** * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch) */ public void acceptSearchMatch(SearchMatch match) throws CoreException { this.resultCollector.accept( match.getResource(), match.getOffset(), match.getOffset() + match.getLength(), (IJavaElement) match.getElement(), match.getAccuracy() ); } /**
public void indexDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) { try { searchDocument.setIndex(index); searchParticipant.indexDocument(searchDocument, indexLocation); } finally { searchDocument.setIndex(null); } } public void indexResolvedDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) {
/** * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch) */ public void acceptSearchMatch(SearchMatch match) throws CoreException { this.resultCollector.accept( match.getResource(), match.getOffset(), match.getOffset() + match.getLength(), (IJavaElement) match.getElement(), match.getAccuracy() ); } /**
public void indexDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) { try { searchDocument.setIndex(index); searchParticipant.indexDocument(searchDocument, indexLocation); } finally { searchDocument.setIndex(null); } } public void indexResolvedDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) {
public void indexDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) { try { searchDocument.setIndex(index); searchParticipant.indexDocument(searchDocument, indexLocation); } finally { searchDocument.setIndex(null); } } public void indexResolvedDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) {