Skip to content

Commit

Permalink
Fix issue with code action popup re-appearing after selecting item
Browse files Browse the repository at this point in the history
And call the callback when codeActionProvider is disabled.
  • Loading branch information
rchl authored and rwols committed Jan 25, 2021
1 parent 818a3c0 commit 2655340
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugin/code_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down

0 comments on commit 2655340

Please sign in to comment.