GoEditor editor = (GoEditor) targetEditor;
ISelection selection = editor.getSelectionProvider().getSelection();
if (selection != null && selection instanceof TextSelection) {
DefaultCharacterPairMatcher matcher = editor.getPairMatcher();
IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
Object obj = editor.getAdapter(Control.class);
if (obj != null && obj instanceof StyledText) {
StyledText st = (StyledText)obj;
int startOffset = st.getCaretOffset();
IRegion r = matcher.match(doc, startOffset);
if (r != null) {
int ro = r.getOffset();
int low = ro + 1;
int high = ro + r.getLength();
int pairOffset = low == startOffset?high:low;