From 3dfda666588004f7773842bcd820dd20ee7a31ea Mon Sep 17 00:00:00 2001 From: dalthviz <16781833+dalthviz@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:06:49 -0500 Subject: [PATCH] Completions: Fix enabling/disabling individual providers --- spyder/plugins/completion/plugin.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/spyder/plugins/completion/plugin.py b/spyder/plugins/completion/plugin.py index 09c14ca88e3..99bc8caa41f 100644 --- a/spyder/plugins/completion/plugin.py +++ b/spyder/plugins/completion/plugin.py @@ -948,7 +948,15 @@ def start_provider_instance(self, provider_name: str): """Start a given provider.""" provider_info = self.providers[provider_name] if provider_info['status'] == self.STOPPED: - provider_info['instance'].start() + provider_instance = provider_info['instance'] + provider_instance.start() + for language in self.language_status: + language_providers = self.language_status[language] + language_providers[provider_name] = ( + provider_instance.start_completion_services_for_language( + language + ) + ) def shutdown_provider_instance(self, provider_name: str): """Shutdown a given provider.""" @@ -956,6 +964,10 @@ def shutdown_provider_instance(self, provider_name: str): if provider_info['status'] == self.RUNNING: provider_info['instance'].shutdown() provider_info['status'] = self.STOPPED + for language in self.language_status: + language_providers = self.language_status[language] + if provider_name in language_providers: + language_providers[provider_name] = False # ---------- Methods to create/access graphical elements ----------- def create_action(self, *args, **kwargs):