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

This commit is contained in:
Nayeem Rahman 2024-04-20 02:00:03 +01:00 committed by GitHub
parent 472a370640
commit 79e6751cf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 199 additions and 118 deletions

View file

@ -404,8 +404,11 @@ impl LanguageServer {
let inner = self.0.read().await;
if let Some(testing_server) = &inner.maybe_testing_server {
match params.map(serde_json::from_value) {
Some(Ok(params)) => testing_server
.run_request(params, inner.config.workspace_settings().clone()),
Some(Ok(params)) => {
testing_server
.run_request(params, inner.config.workspace_settings().clone())
.await
}
Some(Err(err)) => Err(LspError::invalid_params(err.to_string())),
None => Err(LspError::invalid_params("Missing parameters")),
}
@ -972,6 +975,8 @@ impl Inner {
self.config.update_capabilities(&params.capabilities);
}
self.documents.initialize(&self.config);
if let Err(e) = self
.ts_server
.start(self.config.internal_inspect().to_address())