Skip to content

Commit

Permalink
Improve signature help performance (#2329)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann authored Sep 24, 2023
1 parent 36b0bc9 commit fbd9652
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions plugin/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fbd9652

Please sign in to comment.