docs: def clear_messages(self):
          """
          Clears all messages.
          """
          while len(self._messages):
              msg = self._messages.pop(0)
              usd = msg.block.userData()
              if usd and hasattr(usd, 'messages'):
                  usd.messages[:] = []
              if msg.decoration:
                  self.editor.decorations.remove(msg.decoration)