def _toggle_checkable_action(self, checked, editorstack_method, conf_name):
        """Handle the toogle of a checkable action.

        Update editorstacks and the configuration.

        Args:
            checked (bool): State of the action.
            editorstack_method (str): name of EditorStack class that will be
                used to update the changes in each editorstack.
            conf_name (str): configuration setting associated with the action.
        """
        if self.editorstacks:
            for editorstack in self.editorstacks:
                try:
                    editorstack.__getattribute__(editorstack_method)(checked)
                except AttributeError as e:
                    logger.error(e, exc_info=True)
                # Run code analysis when `set_pep8_enabled` is toggled
                if editorstack_method == 'set_pep8_enabled':
                    # TODO: Connect this to the LSP
                    #for finfo in editorstack.data:
                    #    finfo.run_code_analysis(
                    #            self.get_option('code_analysis/pyflakes'),
                    #            checked)
                    pass
        CONF.set('editor', conf_name, checked)