Skip to content

Commit

Permalink
Completions: Fix enabling/disabling individual providers
Browse files Browse the repository at this point in the history
  • Loading branch information
dalthviz committed Oct 27, 2023
1 parent 6d53101 commit 486618a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion spyder/plugins/completion/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,14 +948,26 @@ 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."""
provider_info = self.providers[provider_name]
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):
Expand Down

0 comments on commit 486618a

Please sign in to comment.