use of org.eclipse.lsp4j.CallHierarchyOutgoingCall in project eclipse.jdt.ls by eclipse.
the class CallHierarchyHandler method getOutgoingCallItemsAt.
private List<CallHierarchyOutgoingCall> getOutgoingCallItemsAt(String uri, int line, int character, IProgressMonitor monitor) throws JavaModelException {
SubMonitor sub = SubMonitor.convert(monitor, 2);
IMember candidate = getCallHierarchyElement(uri, line, character, sub.split(1));
if (candidate == null) {
return null;
}
checkMonitor(monitor);
MethodWrapper wrapper = outgoingMethodWrapperCache.containsKey(candidate) ? outgoingMethodWrapperCache.get(candidate) : getCallRoot(candidate, false);
if (wrapper == null) {
return null;
}
MethodWrapper[] calls = wrapper.getCalls(sub.split(1));
if (calls == null) {
return null;
}
List<CallHierarchyOutgoingCall> result = new ArrayList<>();
for (MethodWrapper call : calls) {
Collection<CallLocation> callLocations = call.getMethodCall().getCallLocations();
if (callLocations != null && !callLocations.isEmpty()) {
List<Range> ranges = toCallRanges(callLocations);
for (int i = 0; i < callLocations.size(); i++) {
CallHierarchyItem symbol = toCallHierarchyItem(call.getMember());
result.add(new CallHierarchyOutgoingCall(symbol, ranges));
}
}
IMember member = call.getMember();
if (member != null) {
outgoingMethodWrapperCache.put(member, call);
}
}
return result;
}
Aggregations