Skip to content

Commit

Permalink
Reimplement can_close
Browse files Browse the repository at this point in the history
  • Loading branch information
andfoy committed Jul 15, 2021
1 parent 4ce127b commit d8710d4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spyder/plugins/completion/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,17 @@ def unregister(self):
# TODO: Remove status bar widgets
provider_info['instance'].shutdown()

def can_close(self) -> bool:
"""Check if any provider has any pending task."""
can_close = False
for provider_name in self.providers:
provider_info = self.providers[provider_name]
if provider_info['status'] == self.RUNNING:
provider = provider_info['instance']
provider_can_close = provider.can_close()
can_close |= provider_can_close
return can_close

def on_close(self, cancelable=False) -> bool:
"""Check if any provider has any pending task before closing."""
can_close = False
Expand Down

0 comments on commit d8710d4

Please sign in to comment.