예제 #1
0
파일: plugin.py 프로젝트: imfaisalpk/spyder
    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)
예제 #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.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()
예제 #3
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)
예제 #4
0
    def __init__(self, parent):
        SpyderCompletionPlugin.__init__(self, parent)

        self.clients = {}
        self.requests = set({})
        self.register_queue = {}

        self.update_configuration()
예제 #5
0
파일: plugin.py 프로젝트: kai3341/spyder
 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))
예제 #6
0
 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))
예제 #7
0
 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 = {}
예제 #8
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)

        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)
예제 #9
0
파일: plugin.py 프로젝트: stavna/spyder
    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] = []
예제 #10
0
 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()
예제 #11
0
파일: plugin.py 프로젝트: wpfeder/spyder
    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)