summaryrefslogtreecommitdiff
path: root/cli/lsp/documents.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-08-28 14:17:47 -0400
committerGitHub <noreply@github.com>2024-08-28 14:17:47 -0400
commitb708a13eb02510925b5fd964fe933b4896093185 (patch)
treee20a84f95680439a3eb665245fc7ede27bf4be02 /cli/lsp/documents.rs
parent7dd861aa36974d5afa9633078b51c4c7f17cf181 (diff)
feat: improve lockfile v4 to store normalized version constraints and be more terse (#25247)
Stores normalized version constraints in the lockfile, which will improve reproducibility and will fix a bug with duplicate specifiers ending up in the lockfile. Also, gets rid of some duplicate data in the specifiers area of the lockfile.
Diffstat (limited to 'cli/lsp/documents.rs')
-rw-r--r--cli/lsp/documents.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs
index 80c5a4dc5..dcfdb0d00 100644
--- a/cli/lsp/documents.rs
+++ b/cli/lsp/documents.rs
@@ -1410,11 +1410,9 @@ impl Documents {
if let Some(lockfile) = config_data.lockfile.as_ref() {
let reqs = npm_reqs_by_scope.entry(Some(scope.clone())).or_default();
let lockfile = lockfile.lock();
- for key in lockfile.content.packages.specifiers.keys() {
- if let Some(key) = key.strip_prefix("npm:") {
- if let Ok(req) = PackageReq::from_str(key) {
- reqs.insert(req);
- }
+ for dep_req in lockfile.content.packages.specifiers.keys() {
+ if dep_req.kind == deno_semver::package::PackageKind::Npm {
+ reqs.insert(dep_req.req.clone());
}
}
}