From 2655340b88e775f6954f31707a45f6c8cdc7b2be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ch=C5=82odnicki?= Date: Mon, 25 Jan 2021 10:41:11 +0100 Subject: [PATCH] Fix issue with code action popup re-appearing after selecting item And call the callback when codeActionProvider is disabled. --- plugin/code_actions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/code_actions.py b/plugin/code_actions.py index a0084d89b..99405d509 100644 --- a/plugin/code_actions.py +++ b/plugin/code_actions.py @@ -121,7 +121,8 @@ def _request_async( on_save_actions: Optional[Dict[str, bool]] = None ) -> None: if 'codeActionProvider' in userprefs().disabled_capabilities: - return None + sublime.set_timeout_async(lambda: actions_handler({})) + return use_cache = on_save_actions is None if use_cache: @@ -131,6 +132,7 @@ def _request_async( cache_key, cache_collector = self._response_cache if location_cache_key == cache_key: sublime.set_timeout(lambda: actions_handler(cache_collector.get_actions())) + return else: self._response_cache = None