public static int widgetOffset2ModelOffset(
        ITextViewer viewer,
        int widgetOffset
    ) {
        return viewer instanceof ITextViewerExtension5 ext5
            ? ext5.widgetOffset2ModelOffset(widgetOffset)
            : widgetOffset;
    }
Converts a widget offset to a corresponding model offset in the text viewer.

@param viewer       the text viewer from which the widget offset is taken
@param widgetOffset the offset in the widget
@return the corresponding model offset in the viewer
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/suggestion/TextRenderingUtils.java