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

perf(lsp): only store parsed sources for open documents #23454

Merged

Conversation

nayeemrmn
Copy link
Collaborator

Most of this is changing the way parsed sources are analyzed for tests. Before we stored ASTs for all file: documents so they could be used to do this in the test server. But it's better if we do that immediately after the source is parsed so we don't need to store the AST.

Walking ASTs to collect tests in the document change handler would block the language server and cause a perf regression. Instead we dispatch a task there to collect them in a blocking thread, store the result in Document::maybe_test_module_fut and let that be accessed asynchronously.

Copy link
Member

@nathanwhit nathanwhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM aside from the clippy lint

cli/lsp/testing/server.rs Outdated Show resolved Hide resolved
Copy link
Member

@nathanwhit nathanwhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nayeemrmn nayeemrmn merged commit 79e6751 into denoland:main Apr 20, 2024
17 checks passed
@nayeemrmn nayeemrmn deleted the lsp-document-parsed-source-store-open-only branch April 20, 2024 20:45
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