}
final ITextViewerExtension2 textViewerExtension2 = (ITextViewerExtension2) sourceViewer;
// does a text hover exist?
final ITextHover textHover = textViewerExtension2.getCurrentTextHover();
if (textHover == null) {
// TODO this crashes... why?
// fTextOperationAction.run();
return;
}
final Point hoverEventLocation = textViewerExtension2.getHoverEventLocation();
final int offset = computeOffsetAtLocation(sourceViewer, hoverEventLocation.x,
hoverEventLocation.y);
if (offset == -1) {
fTextOperationAction.run();
return;
}
try {
// get the text hover content
final String contentType = TextUtilities.getContentType(
sourceViewer.getDocument(), IErlangPartitions.ERLANG_PARTITIONING,
offset, true);
final IRegion hoverRegion = textHover.getHoverRegion(sourceViewer, offset);
if (hoverRegion == null) {
return;
}
final String hoverInfo = "";