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

Fix performance regression in Goto Symbol overlay #2348

Merged
merged 2 commits into from
Oct 28, 2023

Conversation

jwortmann
Copy link
Member

@jwortmann jwortmann commented Oct 28, 2023

... which was described in #2346.

This should make the LSP Goto Symbol overlay appear (almost) immediately again, even for very large files, by lazily calculating the character offsets from LSP row/col position (for highlighting and scrolling).

I tested with a file with 5000 symbols in it, where this saves 10k API calls.


By the way, it doesn't really make any sense that this could have been a cause for worse performance, because before the commit 2e06833 the same amount of API calls (for SymbolInformation[] response) were done as well (range_to_region function), or even twice the amount (for DocumentSymbol[] response). Perhaps the ListInputHandler is just slower than window.show_quick_panel, in combination with many recent API calls. Anyway, this seems to work and it looks like a useful improvement to me.

@jwortmann jwortmann force-pushed the symbols-performance branch from d284624 to b5692ac Compare October 28, 2023 03:07
@rchl rchl merged commit 4ff494b into sublimelsp:main Oct 28, 2023
4 checks passed
@jwortmann jwortmann deleted the symbols-performance branch October 28, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants