@Override
            public void linkEntered(HyperlinkEvent e) {
                if (e.getHref() instanceof AnnotationHyperlinkInfo hyperlink) {
                    this.oldSelection = editor.getTextViewer() != null ? editor.getTextViewer().getSelectedRange() : null;
                    Position hyperlinkRegion = hyperlink.getPosition();
                    if (!hyperlinkRegion.isDeleted) {
                        editor.getTextViewer().setSelectedRange(hyperlinkRegion.getOffset(), hyperlinkRegion.getLength());
                    }
                }
            }
Show info from annotations on the specified line
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/util/SQLAnnotationHover.java