summaryrefslogtreecommitdiff
path: root/cli/lsp/documents.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-04-24 17:43:34 -0400
committerGitHub <noreply@github.com>2024-04-24 21:43:34 +0000
commitf3284529f1689f1294929eb17c55ddf088f3d3bb (patch)
tree535046cd96db3a39719f3ca5408bb89d5d0387bf /cli/lsp/documents.rs
parent5a7414e16349d6872a94db38955bf89edf621c30 (diff)
feat(jsr): support importing from jsr via HTTPS specifiers (except for type checking) (#23513)
Closes https://github.com/jsr-io/jsr/issues/322
Diffstat (limited to 'cli/lsp/documents.rs')
-rw-r--r--cli/lsp/documents.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs
index ac8a6c911..2de2a4406 100644
--- a/cli/lsp/documents.rs
+++ b/cli/lsp/documents.rs
@@ -12,6 +12,7 @@ use super::tsc::AssetDocument;
use crate::args::package_json;
use crate::cache::HttpCache;
+use crate::graph_util::CliJsrUrlProvider;
use crate::jsr::JsrCacheResolver;
use crate::lsp::logging::lsp_warn;
use crate::npm::CliNpmResolver;
@@ -409,13 +410,22 @@ impl Document {
.map(|(s, d)| {
(
s.clone(),
- d.with_new_resolver(s, Some(graph_resolver), Some(npm_resolver)),
+ d.with_new_resolver(
+ s,
+ &CliJsrUrlProvider,
+ Some(graph_resolver),
+ Some(npm_resolver),
+ ),
)
})
.collect(),
);
maybe_types_dependency = self.maybe_types_dependency.as_ref().map(|d| {
- Arc::new(d.with_new_resolver(Some(graph_resolver), Some(npm_resolver)))
+ Arc::new(d.with_new_resolver(
+ &CliJsrUrlProvider,
+ Some(graph_resolver),
+ Some(npm_resolver),
+ ))
});
maybe_parsed_source = self.maybe_parsed_source();
maybe_test_module_fut = self
@@ -1409,6 +1419,7 @@ impl Documents {
let graph_import = GraphImport::new(
&referrer,
imports,
+ &CliJsrUrlProvider,
Some(graph_resolver),
Some(npm_resolver),
);
@@ -1745,6 +1756,7 @@ fn analyze_module(
// use a null file system because there's no need to bother resolving
// dynamic imports like import(`./dir/${something}`) in the LSP
file_system: &deno_graph::source::NullFileSystem,
+ jsr_url_provider: &CliJsrUrlProvider,
maybe_resolver: Some(resolver.as_graph_resolver()),
maybe_npm_resolver: Some(resolver.as_graph_npm_resolver()),
},