# 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 Summary

Constructors
Constructor
Description
`DerivedSourceSearchParticipant()`

## Method Summary

Modifier and Type
Method
Description
`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.
`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, selectIndexes`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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:

- `SearchMatch.getElement()` — an `IMember` representing the callee. At minimum, `getElementName()` and `getElementType()` 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 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