diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-08-20 07:55:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-20 14:55:47 +0000 |
commit | 5168700be669179382462214724115a3013cb58e (patch) | |
tree | f30a134722a079b4cc7b2c25a799fe11bf40c6cd /cli/lsp/config.rs | |
parent | f1c58ec041a05276d9f33562a5843c0bb7fb95b3 (diff) |
feat(config): Support frozen lockfile config option in deno.json (#25100)
Closes #24544
Diffstat (limited to 'cli/lsp/config.rs')
-rw-r--r-- | cli/lsp/config.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index e32303baa..f99f1fa10 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -1846,7 +1846,12 @@ fn resolve_lockfile_from_workspace( return None; } }; - resolve_lockfile_from_path(lockfile_path) + let frozen = workspace + .workspace + .root_deno_json() + .and_then(|c| c.to_lock_config().ok().flatten().map(|c| c.frozen())) + .unwrap_or(false); + resolve_lockfile_from_path(lockfile_path, frozen) } fn resolve_node_modules_dir( @@ -1875,8 +1880,11 @@ fn resolve_node_modules_dir( canonicalize_path_maybe_not_exists(&node_modules_dir).ok() } -fn resolve_lockfile_from_path(lockfile_path: PathBuf) -> Option<CliLockfile> { - match CliLockfile::read_from_path(lockfile_path, false) { +fn resolve_lockfile_from_path( + lockfile_path: PathBuf, + frozen: bool, +) -> Option<CliLockfile> { + match CliLockfile::read_from_path(lockfile_path, frozen) { Ok(value) => { if value.filename.exists() { if let Ok(specifier) = ModuleSpecifier::from_file_path(&value.filename) |