<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_highlighter(self, highlighter):
 """ Sets given highlighter as the current document highlighter. :param highlighter: Highlighter. :type highlighter: QSyntaxHighlighter :return: Method success. :rtype: bool """


        if not issubclass(highlighter.__class__, QSyntaxHighlighter):
            raise foundations.exceptions.ProgrammingError("{0} | '{1}' is not a 'QSyntaxHighlighter' subclass!".format(
                self.__class__.__name__, highlighter))

        if self.__highlighter:
            self.remove_highlighter()

        LOGGER.debug("> Setting '{0}' highlighter.".format(highlighter))
        self.__highlighter = highlighter

        return True