code: def highlight_matching_symbols_pairs(editor):
      
  
      format = editor.language.theme.get("accelerator.pair")
      if not format:
          return False
  
      extra_selections = editor.extraSelections() or []
      if not editor.isReadOnly():
          start_selection = QTextEdit.ExtraSelection()
          start_selection.format.setBackground(format.background())
          end_selection = QTextEdit.ExtraSelection()
          end_selection.format.setBackground(format.background())
  
          cursor = editor.textCursor()
          if cursor.hasSelection():
              text = foundations.strings.to_string(cursor.selectedText())
          else:
              cursor.movePosition(QTextCursor.PreviousCharacter, QTextCursor.KeepAnchor)
              text = foundations.strings.to_string(cursor.selectedText())
  
          start_selection.cursor = cursor
  
          if text in editor.language.symbols_pairs.keys():
              extra_selections.append(start_selection)
              end_selection.cursor = editor.get_matching_symbols_pairs(cursor,
                                                                       text,
                                                                       editor.language.symbols_pairs[text])
          elif text in editor.language.symbols_pairs.values():
              extra_selections.append(start_selection)
              end_selection.cursor = editor.get_matching_symbols_pairs(cursor,
                                                                       text,
                                                                       editor.language.symbols_pairs.get_first_key_from_value(
                                                                           text),
                                                                       True)
          else:
              return False
  
          extra_selections.append(end_selection)
      editor.setExtraSelections(extra_selections)
      return True
docs: Highlights given editor matching pairs.
  
      :param editor: Document editor.
      :type editor: QWidget
      :return: Method success.
      :rtype: bool