summaryrefslogtreecommitdiff
path: root/cli/lsp/language_server.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-06-10 11:09:45 -0400
committerGitHub <noreply@github.com>2023-06-10 11:09:45 -0400
commit7f15126f23d97f20a4fb33e43136cd4d13825863 (patch)
tree85d77389969b31999680059e65954a9fa863758e /cli/lsp/language_server.rs
parentf3326eebd6af2aaca1543e8cb543a7b16762bc96 (diff)
chore(tests): test_util - Add `PathRef` (#19450)
This adds a new `PathRef` struct to test_util for making it easier to work with paths in test code. I'm going to expand on this more in the future.
Diffstat (limited to 'cli/lsp/language_server.rs')
-rw-r--r--cli/lsp/language_server.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs
index ecd91f459..cf7179670 100644
--- a/cli/lsp/language_server.rs
+++ b/cli/lsp/language_server.rs
@@ -605,11 +605,13 @@ impl Inner {
let dir = DenoDir::new(None).expect("could not access DENO_DIR");
let module_registries_location = dir.registries_folder_path();
let http_client = Arc::new(HttpClient::new(None, None));
- let module_registries =
- ModuleRegistry::new(&module_registries_location, http_client.clone());
+ let module_registries = ModuleRegistry::new(
+ module_registries_location.clone(),
+ http_client.clone(),
+ );
let location = dir.deps_folder_path();
- let documents = Documents::new(&location);
- let deps_http_cache = HttpCache::new(&location);
+ let documents = Documents::new(location.clone());
+ let deps_http_cache = HttpCache::new(location);
let cache_metadata = cache::CacheMetadata::new(deps_http_cache.clone());
let performance = Arc::new(Performance::default());
let ts_server = Arc::new(TsServer::new(performance.clone()));
@@ -944,14 +946,14 @@ impl Inner {
.clone(),
));
self.module_registries = ModuleRegistry::new(
- &module_registries_location,
+ module_registries_location.clone(),
self.http_client.clone(),
);
self.module_registries_location = module_registries_location;
// update the cache path
let location = dir.deps_folder_path();
- self.documents.set_location(&location);
- self.cache_metadata.set_location(&location);
+ self.documents.set_location(location.clone());
+ self.cache_metadata.set_location(location);
self.maybe_cache_path = new_cache_path;
Ok(())
}