Class DerivedSourceSearchParticipant

java.lang.Object
org.eclipse.jdt.core.search.SearchParticipant
org.eclipse.jdt.core.search.DerivedSourceSearchParticipant

public abstract class DerivedSourceSearchParticipant extends SearchParticipant
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 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 SearchMatch represents a call site within the member's body:

      Parameters:
      caller - the member whose callees are requested
      document - the search document for the caller's source file
      monitor - progress monitor, or null
      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

      public ICompilationUnit getCompilationUnit(org.eclipse.core.resources.IFile file)
      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