Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Fix enabling/disabling individual providers (Completions) #21463

Merged
merged 1 commit into from
Oct 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading