Beispiel #1
0
    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)
Beispiel #2
0
    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.client.sig_response_ready.connect(self._kite_onboarding)
        self.client.sig_status_response_ready.connect(self._kite_onboarding)
        self.client.sig_onboarding_response_ready.connect(
            self._show_onboarding_file)

        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()
Beispiel #3
0
 def __init__(self, parent):
     SpyderCompletionPlugin.__init__(self, parent)
     self.snippets_actor = SnippetsActor(self)
     self.snippets_actor.sig_snippets_ready.connect(
         lambda: self.sig_plugin_ready.emit(self.COMPLETION_CLIENT_NAME))
     self.snippets_actor.sig_snippets_response.connect(
         lambda _id, resp: self.sig_response_ready.emit(
             self.COMPLETION_CLIENT_NAME, _id, resp))
     self.started = False
     self.requests = {}
     self.update_configuration()
Beispiel #4
0
    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)
        self.wait_for_ms = self.get_option('completions_wait_for_ms',
                                           section='editor')

        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)
Beispiel #5
0
    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:
            self.status_widget = LSPStatusWidget(parent=None, plugin=self)
            statusbar = self.main.statusbar
            statusbar.add_status_widget(self.status_widget)

        # TODO: Move to register in the new API
        self.sig_exception_occurred.connect(
            self.main.console.handle_exception)