Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve signature help performance #2329

Merged
merged 1 commit into from
Sep 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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