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

lsp: cache swc ASTs #11345

Closed
7 tasks done
dsherret opened this issue Jul 9, 2021 · 0 comments · Fixed by #11780
Closed
7 tasks done

lsp: cache swc ASTs #11345

dsherret opened this issue Jul 9, 2021 · 0 comments · Fixed by #11780
Assignees
Labels
lsp related to the language server refactor

Comments

@dsherret
Copy link
Member

dsherret commented Jul 9, 2021

I'm breaking this out of #11032

Also, caching the swc parse of the module in the document info would be a good thing I think. That might take a bit more structuring of code. It is used in dependency analysis of the document as well as the test code lens and also use by the linting (though I don't know how easy it would be to send it to deno_lint without a bigger refactor of one or the other).

Steps:

  • Remove use of SourceMap and SourceFile in the code because they don't implement Send without turning on swc_common's concurrent feature, which is not something I want to do because then all the code will use locks internally (which we don't need... slower), open us up to a new class of possible bugs, and it's a global change.
  • Replace SingleThreadedComments implementation of Comments with a version that implements Send.
  • Store the ParsedModule in the document cache and use it throughout the code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lsp related to the language server refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant