diff --git a/plugin/documents.py b/plugin/documents.py index 243a443b3..167e4221e 100644 --- a/plugin/documents.py +++ b/plugin/documents.py @@ -566,16 +566,17 @@ def do_signature_help_async(self, manual: bool) -> None: language_map = session.markdown_language_id_to_st_syntax_map() request = Request.signatureHelp(params, self.view) session.send_request_async(request, lambda resp: self._on_signature_help(resp, pos, language_map)) - elif self.view.match_selector(pos, "meta.function-call.arguments"): - # Don't force close the signature help popup while the user is typing the parameters. - # See also: https://github.com/sublimehq/sublime_text/issues/5518 - pass - else: - # TODO: Refactor popup usage to a common class. We now have sigHelp, completionDocs, hover, and diags - # all using a popup. Most of these systems assume they have exclusive access to a popup, while in - # reality there is only one popup per view. - self.view.hide_popup() - self._sighelp = None + elif self._sighelp: + if self.view.match_selector(pos, "meta.function-call.arguments"): + # Don't force close the signature help popup while the user is typing the parameters. + # See also: https://github.com/sublimehq/sublime_text/issues/5518 + pass + else: + # TODO: Refactor popup usage to a common class. We now have sigHelp, completionDocs, hover, and diags + # all using a popup. Most of these systems assume they have exclusive access to a popup, while in + # reality there is only one popup per view. + self.view.hide_popup() + self._sighelp = None def _get_signature_help_session(self) -> Optional[Session]: # NOTE: We take the beginning of the region to check the previous char (see last_char variable). This is for