diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-08-08 10:23:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-08 14:23:02 +0000 |
commit | 05f838a57cc5b5e7b262e1640baa4d93dfb0df28 (patch) | |
tree | f13f97b5988c537023c05033bf862c52e74d080c /cli/lsp/diagnostics.rs | |
parent | a037ed77a2b2dbef1d2c4175c0401738a13f13bd (diff) |
refactor: use deno_cache_dir crate (#20092)
Uses https://github.com/denoland/deno_cache/pull/26
Diffstat (limited to 'cli/lsp/diagnostics.rs')
-rw-r--r-- | cli/lsp/diagnostics.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs index 88c4c91cb..4e24673f3 100644 --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -1331,6 +1331,7 @@ fn generate_deno_diagnostics( mod tests { use super::*; use crate::cache::GlobalHttpCache; + use crate::cache::RealDenoCacheEnv; use crate::lsp::config::ConfigSnapshot; use crate::lsp::config::Settings; use crate::lsp::config::SpecifierSettings; @@ -1349,7 +1350,10 @@ mod tests { location: &Path, maybe_import_map: Option<(&str, &str)>, ) -> StateSnapshot { - let cache = Arc::new(GlobalHttpCache::new(location.to_path_buf())); + let cache = Arc::new(GlobalHttpCache::new( + location.to_path_buf(), + RealDenoCacheEnv, + )); let mut documents = Documents::new(cache); for (specifier, source, version, language_id) in fixtures { let specifier = @@ -1374,7 +1378,7 @@ mod tests { maybe_import_map, assets: Default::default(), cache_metadata: cache::CacheMetadata::new(Arc::new( - GlobalHttpCache::new(location.to_path_buf()), + GlobalHttpCache::new(location.to_path_buf(), RealDenoCacheEnv), )), maybe_node_resolver: None, maybe_npm_resolver: None, @@ -1424,7 +1428,8 @@ let c: number = "a"; None, ); let snapshot = Arc::new(snapshot); - let cache = Arc::new(GlobalHttpCache::new(cache_location)); + let cache = + Arc::new(GlobalHttpCache::new(cache_location, RealDenoCacheEnv)); let ts_server = TsServer::new(Default::default(), cache); // test enabled @@ -1517,7 +1522,8 @@ let c: number = "a"; None, ); let snapshot = Arc::new(snapshot); - let cache = Arc::new(GlobalHttpCache::new(cache_location)); + let cache = + Arc::new(GlobalHttpCache::new(cache_location, RealDenoCacheEnv)); let ts_server = TsServer::new(Default::default(), cache); let config = mock_config(); |