Class DerivedSourceSearchParticipant
java.lang.Object
org.aspectj.org.eclipse.jdt.core.search.SearchParticipant
org.aspectj.org.eclipse.jdt.core.search.DerivedSourceSearchParticipant
A search participant for non-Java source files registered under the
org.eclipse.jdt.core.javaDerivedSource content type (e.g. Kotlin,
Scala).
Subclasses must implement locateCallees(IMember, SearchDocument, IProgressMonitor) to enable outgoing call hierarchy for their language.
This class is intended to be subclassed by clients contributing to the
org.eclipse.jdt.core.derivedSourceSearchParticipant extension point.
- Since:
- 3.46
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCompilationUnit(org.eclipse.core.resources.IFile file) Returns an ICompilationUnit for the given source file, or null if this participant does not provide structured models.abstract SearchMatch[]locateCallees(IMember caller, SearchDocument document, org.eclipse.core.runtime.IProgressMonitor monitor) Locates methods and types invoked by the given member.Methods inherited from class SearchParticipant
beginSearching, doneSearching, getDescription, getDocument, indexDocument, indexResolvedDocument, locateMatches, removeIndex, resolveDocument, scheduleDocumentIndexing, selectIndexesModifier and TypeMethodDescriptionvoidNotification that this participant's help is needed in a search.voidNotification that this participant's help is no longer needed.Returns a displayable name of this search participant.abstract SearchDocumentgetDocument(String documentPath) Returns a search document for the given path.abstract voidindexDocument(SearchDocument document, org.eclipse.core.runtime.IPath indexLocation) Indexes the given document in the given index.voidindexResolvedDocument(SearchDocument document, org.eclipse.core.runtime.IPath indexLocation) Indexes the given resolved document in the given index.abstract voidlocateMatches(SearchDocument[] documents, SearchPattern pattern, IJavaSearchScope scope, SearchRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) Locates the matches in the given documents using the given search pattern and search scope, and reports them to the given search requestor.voidremoveIndex(org.eclipse.core.runtime.IPath indexLocation) Removes the index for a given path.voidresolveDocument(SearchDocument document) Resolves the given document.final voidscheduleDocumentIndexing(SearchDocument document, org.eclipse.core.runtime.IPath indexPath) Schedules the indexing of the given document.abstract org.eclipse.core.runtime.IPath[]selectIndexes(SearchPattern query, IJavaSearchScope scope) Returns the collection of index locations to consider when performing the given search query in the given scope.
-
Constructor Details
-
DerivedSourceSearchParticipant
public DerivedSourceSearchParticipant()
-
-
Method Details
-
locateCallees
public abstract SearchMatch[] locateCallees(IMember caller, SearchDocument document, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Locates methods and types invoked by the given member. Called by the call hierarchy engine when Java AST-based callee analysis is not available (i.e., the member's source is not Java).Each returned
SearchMatchrepresents a call site within the member's body:SearchMatch.getElement()— anIMemberrepresenting the callee. At minimum,getElementName()andgetElementType()must return meaningful values. The call hierarchy engine will attempt to resolve this to a full declaration via declaration search.SearchMatch.getOffset()/SearchMatch.getLength()— the call site location in the caller's source.SearchMatch.getResource()— the caller's resource.
- Parameters:
caller- the member whose callees are requesteddocument- the search document for the caller's source filemonitor- progress monitor, ornull- Returns:
- array of search matches representing call sites (never null)
- Throws:
org.eclipse.core.runtime.CoreException- if an error occurs during callee analysis- Since:
- 3.46
-
getCompilationUnit
Returns an ICompilationUnit for the given source file, or null if this participant does not provide structured models. Called by language servers to resolve non-Java source files to type roots for features like document symbols, hover, go-to-definition, and code lenses.The default implementation returns null. Subclasses that provide structured models for their language should override this to return a compilation unit populated with type/method/field children.
- Parameters:
file- the workspace file- Returns:
- compilation unit, or null
- Since:
- 3.46
-