def on_settings_changed(): global settings updated_settings = load_settings() if updated_settings.verbosity != settings.verbosity: Log._set_verbosity(updated_settings.verbosity) elif updated_settings.add_to_PATH != settings.add_to_PATH: Log.normal("Settings changed, reloading backends") StackIDEManager.configure(updated_settings) StackIDEManager.reset() elif updated_settings.show_popup != settings.show_popup: Win.show_popup = updated_settings.show_popup settings = updated_settings
def test_reset(self): window = mock_window(['.']) sublime.add_window(window) StackIDEManager.check_windows() self.assertEqual(1, len(StackIDEManager.ide_backend_instances)) # substitute a 'live' instance backend = MagicMock() stack_ide.stack_ide_loadtargets = Mock(return_value=['app/Main.hs', 'src/Lib.hs']) instance = stack_ide.StackIDE(window, test_settings, backend) StackIDEManager.ide_backend_instances[window.id()] = instance StackIDEManager.reset() # instances should be shut down. self.assertEqual(1, len(StackIDEManager.ide_backend_instances)) self.assertFalse(instance.is_alive) backend.send_request.assert_called_with(Req.get_shutdown()) sublime.destroy_windows()
def run(self): StackIDEManager.reset()
def plugin_unloaded(): global watchdog watchdog.kill() StackIDEManager.reset() watchdog = None