def __init__(self, parent, plugins=['lsp', 'kite', 'fallback']): SpyderCompletionPlugin.__init__(self, parent) self.clients = {} self.requests = {} self.language_status = {} self.started = False self.first_completion = False self.req_id = 0 self.completion_first_time = 500 self.waiting_time = 1000 self.collection_mutex = QMutex() self.plugin_priority = { LSPRequestTypes.DOCUMENT_COMPLETION: 'lsp', LSPRequestTypes.DOCUMENT_SIGNATURE: 'lsp', LSPRequestTypes.DOCUMENT_HOVER: 'lsp', 'all': 'lsp' } self.response_priority = ['lsp', 'kite', 'fallback'] for plugin in plugins: if plugin in self.BASE_PLUGINS: Plugin = self.BASE_PLUGINS[plugin] plugin_client = Plugin(self.main) self.register_completion_plugin(plugin_client)
def __init__(self, parent): SpyderCompletionPlugin.__init__(self, parent) self.available_languages = [] self.client = KiteClient(None) self.kite_process = None # Installation dialog self.installation_thread = KiteInstallationThread(self) self.installer = KiteInstallerDialog(parent, self.installation_thread) # Status widget statusbar = parent.statusBar() # MainWindow status bar self.open_file_updated = False self.status_widget = KiteStatusWidget(None, statusbar, self) # Signals self.client.sig_client_started.connect(self.http_client_ready) self.client.sig_status_response_ready[str].connect(self.set_status) self.client.sig_status_response_ready[dict].connect(self.set_status) self.client.sig_response_ready.connect( functools.partial(self.sig_response_ready.emit, self.COMPLETION_CLIENT_NAME)) self.installation_thread.sig_installation_status.connect( self.set_status) self.status_widget.sig_clicked.connect(self.show_installation_dialog) self.main.sig_setup_finished.connect(self.mainwindow_setup_finished) # Config self.update_configuration()
def __init__(self, parent): SpyderCompletionPlugin.__init__(self, parent) self.clients = {} self.clients_restart_count = {} self.clients_restart_timers = {} self.clients_restarting = {} self.clients_hearbeat = {} self.clients_statusbar = {} self.requests = set({}) self.register_queue = {} self.update_configuration() self.show_no_external_server_warning = True self._mainwindow_setup_finished = False # Signals self.main.sig_setup_finished.connect(self.on_mainwindow_setup_finished) # Status bar widget if parent is not None: statusbar = parent.statusBar() self.status_widget = LSPStatusWidget(None, statusbar, plugin=self) # TODO: Move to register in the new API self.sig_exception_occurred.connect(self.main.console.handle_exception)
def __init__(self, parent): SpyderCompletionPlugin.__init__(self, parent) self.clients = {} self.requests = set({}) self.register_queue = {} self.update_configuration()
def __init__(self, parent): SpyderCompletionPlugin.__init__(self, parent) self.available_languages = [] self.client = KiteClient(None) self.kite_process = None self.client.sig_client_started.connect(self.http_client_ready) self.client.sig_response_ready.connect( functools.partial(self.sig_response_ready.emit, self.COMPLETION_CLIENT_NAME))
def __init__(self, parent): SpyderCompletionPlugin.__init__(self, parent) self.available_languages = [] enable_code_snippets = CONF.get('lsp-server', 'code_snippets') self.client = KiteClient(None, enable_code_snippets) self.kite_process = None self.client.sig_client_started.connect(self.http_client_ready) self.client.sig_response_ready.connect( functools.partial(self.sig_response_ready.emit, self.COMPLETION_CLIENT_NAME))
def __init__(self, parent): SpyderCompletionPlugin.__init__(self, parent) self.fallback_actor = FallbackActor(self) self.fallback_actor.sig_fallback_ready.connect( lambda: self.sig_plugin_ready.emit(self.COMPLETION_CLIENT_NAME)) self.fallback_actor.sig_set_tokens.connect( lambda _id, resp: self.sig_response_ready.emit( self.COMPLETION_CLIENT_NAME, _id, resp)) self.started = False self.requests = {}
def __init__(self, parent, plugins=['lsp', 'kite', 'fallback']): SpyderCompletionPlugin.__init__(self, parent) self.clients = {} self.requests = {} self.language_status = {} self.started = False self.req_id = 0 self.collection_mutex = QMutex(QMutex.Recursive) for plugin in plugins: if plugin in self.BASE_PLUGINS: Plugin = self.BASE_PLUGINS[plugin] plugin_client = Plugin(self.main) self.register_completion_plugin(plugin_client)
def __init__(self, parent): SpyderCompletionPlugin.__init__(self, parent) self.clients = {} self.requests = set({}) self.register_queue = {} # Register languages to create clients for for language in self.get_languages(): self.clients[language] = { 'status': self.STOPPED, 'config': self.get_language_config(language), 'instance': None } self.register_queue[language] = []
def __init__(self, parent): SpyderCompletionPlugin.__init__(self, parent) self.available_languages = [] self.client = KiteClient(None) self.kite_process = None self.kite_installation_thread = KiteInstallationThread(self) # TODO: Connect thread status to status bar self.kite_installer = KiteInstallerDialog( parent, self.kite_installation_thread) self.client.sig_client_started.connect(self.http_client_ready) self.client.sig_response_ready.connect( functools.partial(self.sig_response_ready.emit, self.COMPLETION_CLIENT_NAME)) self.kite_installation_thread.sig_installation_status.connect( lambda status: self.client.start() if status == FINISHED else None) self.main.sig_setup_finished.connect(self.mainwindow_setup_finished) self.update_configuration()
def __init__(self, parent): SpyderCompletionPlugin.__init__(self, parent) self.clients = {} self.clients_restart_count = {} self.clients_restart_timers = {} self.clients_restarting = {} self.clients_hearbeat = {} self.clients_statusbar = {} self.requests = set({}) self.register_queue = {} self.update_configuration() self.show_no_external_server_warning = True # Status bar widget if parent is not None: statusbar = parent.statusBar() self.status_widget = LSPStatusWidget(None, statusbar, plugin=self)