Search in sources :

Example 1 with CallHierarchyIncomingCallsRequest

use of org.lxtk.lx4e.requests.CallHierarchyIncomingCallsRequest in project lxtk by lxtk-org.

the class CallHierarchyUtility method getIncomingCalls.

/**
 * Returns the incoming calls for the given call hierarchy item.
 *
 * @param item not <code>null</code>
 * @param monitor a progress monitor, or <code>null</code>
 *  if progress reporting is not desired. The caller must not rely on
 *  {@link IProgressMonitor#done()} having been called by the receiver
 * @return a list of incoming calls (may be <code>null</code> or empty)
 */
public List<CallHierarchyIncomingCall> getIncomingCalls(CallHierarchyItem item, IProgressMonitor monitor) {
    CallHierarchyIncomingCallsRequest request = newIncomingCallsRequest();
    request.setProvider(provider);
    request.setParams(new CallHierarchyIncomingCallsParams(item));
    request.setProgressMonitor(monitor);
    request.setUpWorkDoneProgress(() -> new DefaultWorkDoneProgress(Either.forLeft(UUID.randomUUID().toString())));
    request.setMayThrow(false);
    return request.sendAndReceive();
}
Also used : CallHierarchyIncomingCallsParams(org.eclipse.lsp4j.CallHierarchyIncomingCallsParams) DefaultWorkDoneProgress(org.lxtk.DefaultWorkDoneProgress) CallHierarchyIncomingCallsRequest(org.lxtk.lx4e.requests.CallHierarchyIncomingCallsRequest)

Aggregations

CallHierarchyIncomingCallsParams (org.eclipse.lsp4j.CallHierarchyIncomingCallsParams)1 DefaultWorkDoneProgress (org.lxtk.DefaultWorkDoneProgress)1 CallHierarchyIncomingCallsRequest (org.lxtk.lx4e.requests.CallHierarchyIncomingCallsRequest)1