Add a extension to the editor.

        :param extension: The extension instance to add.

def add(self, extension):
        """
        Add a extension to the editor.

        :param extension: The extension instance to add.

        """
        logger.debug('adding extension {}'.format(extension.name))
        self._extensions[extension.name] = extension
        extension.on_install(self.editor)
        return extension