diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2020-12-21 14:44:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 08:44:26 -0500 |
commit | bd85d0ed420b792eebdd81f88fca503e028c9565 (patch) | |
tree | d6f8d5baf4c3c0d760bea2b6b221189674d2e54b /cli/lsp/sources.rs | |
parent | 3078fcf55a8aa04d26316ab353d84f2c9512bd47 (diff) |
refactor: rewrite lsp to be async (#8727)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Diffstat (limited to 'cli/lsp/sources.rs')
-rw-r--r-- | cli/lsp/sources.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cli/lsp/sources.rs b/cli/lsp/sources.rs index 09b0a4cc8..63b4ebd99 100644 --- a/cli/lsp/sources.rs +++ b/cli/lsp/sources.rs @@ -18,8 +18,6 @@ use std::collections::HashMap; use std::fs; use std::path::Path; use std::path::PathBuf; -use std::sync::Arc; -use std::sync::RwLock; use std::time::SystemTime; #[derive(Debug, Clone, Default)] @@ -34,7 +32,7 @@ struct Metadata { #[derive(Debug, Clone, Default)] pub struct Sources { http_cache: HttpCache, - maybe_import_map: Option<Arc<RwLock<ImportMap>>>, + maybe_import_map: Option<ImportMap>, metadata: HashMap<ModuleSpecifier, Metadata>, redirects: HashMap<ModuleSpecifier, ModuleSpecifier>, remotes: HashMap<ModuleSpecifier, PathBuf>, @@ -102,7 +100,7 @@ impl Sources { &specifier, &source, &media_type, - None, + &None, ) { maybe_types = mt; Some(dependencies) @@ -132,7 +130,7 @@ impl Sources { Some(analysis::resolve_import( types, &specifier, - self.maybe_import_map.clone(), + &self.maybe_import_map, )) } else { None @@ -142,7 +140,7 @@ impl Sources { &specifier, &source, &media_type, - None, + &None, ) { if maybe_types.is_none() { maybe_types = mt; |