diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-06-28 17:18:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-28 17:18:21 -0700 |
commit | bc8a0e6e68547cf07a246b8b6c886de155dc8282 (patch) | |
tree | a3540b01218c4674c399eb770c0f08e5ba594793 /cli/lsp/language_server.rs | |
parent | 2ddae872f956ddd84656a302aa5f6b752f6a6ab5 (diff) |
refactor(cli): Create wrapper around `deno_lockfile::Lockfile` (#24366)
As suggested in
https://github.com/denoland/deno/pull/24355#discussion_r1657875422.
I wasn't able to hide the mutex stuff as much as I'd like (ended up just
adding an escape hatch `inner()` method that locks the inner mutex),
because you can't return references to the inner fields through a mutex.
This is mostly motivated by the frozen lockfile changes
Diffstat (limited to 'cli/lsp/language_server.rs')
-rw-r--r-- | cli/lsp/language_server.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 35bfa7f78..c4f3789ca 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -86,7 +86,6 @@ use super::tsc::TsServer; use super::urls; use crate::args::create_default_npmrc; use crate::args::get_root_cert_store; -use crate::args::write_lockfile_if_has_changes; use crate::args::CaData; use crate::args::CacheSetting; use crate::args::CliOptions; @@ -274,8 +273,7 @@ impl LanguageServer { // Update the lockfile on the file system with anything new // found after caching if let Some(lockfile) = cli_options.maybe_lockfile() { - let mut lockfile = lockfile.lock(); - if let Err(err) = write_lockfile_if_has_changes(&mut lockfile) { + if let Err(err) = &lockfile.write_if_changed() { lsp_warn!("{:#}", err); } } |