def test_unsaved_views(self): """Test that we gracefully handle unsaved views.""" # Construct an unsaved scratch view. self.view = sublime.active_window().new_file() self.view.set_scratch(True) # Manually set up a completer. manager = SettingsManager() settings = manager.settings_for_view(self.view) view_config_manager = ViewConfigManager() view_config = view_config_manager.load_for_view(self.view, settings) self.assertIsNone(view_config)
def set_up_completer(self): """Utility method to set up a completer for the current view. Returns: BaseCompleter: completer for the current view. """ manager = SettingsManager() settings = manager.settings_for_view(self.view) settings.use_libclang = self.use_libclang view_config_manager = ViewConfigManager() view_config = view_config_manager.load_for_view(self.view, settings) completer = view_config.completer return completer
def set_up_completer(self): """Set up a completer for the current view. Returns: BaseCompleter: completer for the current view. """ manager = SettingsManager() settings = manager.settings_for_view(self.view) settings.use_libclang = self.use_libclang view_config_manager = ViewConfigManager() view_config = view_config_manager.load_for_view(self.view, settings) completer = view_config.completer return completer