}
final ConnectedTargetData connectedTargetData = wrapper.getConnectedTargetData();
if (connectedTargetData == null) {
return null;
}
final JsFunction jsFunction = getJsFunctionFromElement(wrapper);
if (jsFunction == null) {
return null;
}
return new Runnable() {
public void run() {
// This works in UI thread.
IWorkbench workbench = PlatformUI.getWorkbench();
final IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
ISourceLocator sourceLocator =
connectedTargetData.getDebugTarget().getLaunch().getSourceLocator();
if (sourceLocator instanceof ISourceLookupDirector == false) {
return;
}
ISourceLookupDirector director = (ISourceLookupDirector) sourceLocator;
SourcePositionMap positionMap = connectedTargetData.getSourcePositionMap();
SourcePosition userPosition;
{
// First get VM positions.
Script script = jsFunction.getScript();
if (script == null) {
return;
}
TextStreamPosition functionOpenParenPosition = jsFunction.getOpenParenPosition();
if (functionOpenParenPosition == null) {
return;
}
// Convert them to user positions.