diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-04-05 18:33:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-05 22:33:01 +0000 |
commit | 83f92474c5e8375ebe2213b4d62d4211fd011c2f (patch) | |
tree | 2fb1d6b80c68bd1f6f1b0f07e0ed41eac3bcf356 /cli/lsp/language_server.rs | |
parent | 61f1b8e8dc20846093a8b24a8f511a09bbf09919 (diff) |
perf(lsp): use lockfile to reduce npm pkg resolution time (#23247)
This functionality was broken. The series of events was:
1. Load the npm resolution from the lockfile.
2. Discover only a subset of the specifiers in the documents.
3. Clear the npm snapshot.
4. Redo npm resolution with the new specifiers (~500ms).
What this now does:
1. Load the npm resolution from the lockfile.
2. Discover only a subset of the specifiers in the documents and take
into account the specifiers from the lockfile.
3. Do not redo resolution (~1ms).
Diffstat (limited to 'cli/lsp/language_server.rs')
-rw-r--r-- | cli/lsp/language_server.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 17145f32c..bf53623f7 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -364,7 +364,7 @@ impl LanguageServer { { let mut inner = self.0.write().await; let lockfile = inner.config.tree.root_lockfile().cloned(); - inner.documents.refresh_jsr_resolver(lockfile); + inner.documents.refresh_lockfile(lockfile); inner.refresh_npm_specifiers().await; } // now refresh the data in a read |