diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-02-12 22:49:42 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-12 22:49:42 +1100 |
commit | 79916226b74bf9593afacbcdfe9d58263bed132f (patch) | |
tree | c67584ff535adfe98fa7f8cdd6e27a9c4bf233e0 /cli/lsp/documents.rs | |
parent | 54e53cc9ea0767dfe8a44f92361f68c03f5f038f (diff) |
fix(lsp): properly handle static assets (#9476)
Diffstat (limited to 'cli/lsp/documents.rs')
-rw-r--r-- | cli/lsp/documents.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index e8ea0e2cf..2a9906958 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -96,7 +96,7 @@ impl DocumentCache { version: i32, content_changes: Vec<TextDocumentContentChangeEvent>, ) -> Result<Option<String>, AnyError> { - if !self.contains(specifier) { + if !self.contains_key(specifier) { return Err(custom_error( "NotFound", format!( @@ -119,7 +119,7 @@ impl DocumentCache { } } - pub fn contains(&self, specifier: &ModuleSpecifier) -> bool { + pub fn contains_key(&self, specifier: &ModuleSpecifier) -> bool { self.docs.contains_key(specifier) } @@ -213,8 +213,8 @@ mod tests { let missing_specifier = ModuleSpecifier::resolve_url("file:///a/c.ts").unwrap(); document_cache.open(specifier.clone(), 1, "console.log(\"Hello Deno\");\n"); - assert!(document_cache.contains(&specifier)); - assert!(!document_cache.contains(&missing_specifier)); + assert!(document_cache.contains_key(&specifier)); + assert!(!document_cache.contains_key(&missing_specifier)); } #[test] |