diff --git a/plugin/code_actions.py b/plugin/code_actions.py index 8b8d4f2f6..385b9d0d1 100644 --- a/plugin/code_actions.py +++ b/plugin/code_actions.py @@ -291,7 +291,7 @@ def run(self, edit: sublime.Edit, event: Optional[dict] = None, only_kinds: Opti def handle_responses_async(self, responses: CodeActionsByConfigName) -> None: self.commands_by_config = responses self.commands = self.combine_commands() - self.show_popup_menu() + self.show_code_actions() def combine_commands(self) -> 'List[Tuple[str, str, CodeActionOrCommand]]': results = [] @@ -300,9 +300,12 @@ def combine_commands(self) -> 'List[Tuple[str, str, CodeActionOrCommand]]': results.append((config, command['title'], command)) return results - def show_popup_menu(self) -> None: + def show_code_actions(self) -> None: if len(self.commands) > 0: - self.view.show_popup_menu([command[1] for command in self.commands], self.handle_select) + items = [command[1] for command in self.commands] + window = self.view.window() + if window: + window.show_quick_panel(items, self.handle_select, placeholder="Code action") else: self.view.show_popup('No actions available', sublime.HIDE_ON_MOUSE_MOVE_AWAY) diff --git a/plugin/hover.py b/plugin/hover.py index c5538b0d0..f814d9bce 100644 --- a/plugin/hover.py +++ b/plugin/hover.py @@ -182,7 +182,10 @@ def _on_navigate(self, href: str, point: int) -> None: _, config_name = href.split(":") titles = [command["title"] for command in self._actions_by_config[config_name]] self.view.run_command("lsp_selection_set", {"regions": [(point, point)]}) - self.view.show_popup_menu(titles, lambda i: self.handle_code_action_select(config_name, i)) + window = self.view.window() + if window: + window.show_quick_panel(titles, lambda i: self.handle_code_action_select(config_name, i), + placeholder="Code actions") elif href.startswith("location:"): window = self.view.window() if window: