summaryrefslogtreecommitdiff
path: root/cli/lsp/config.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-09-16 21:39:37 +0100
committerGitHub <noreply@github.com>2024-09-16 21:39:37 +0100
commit62e952559f600e72d7498c9b12f906cb0b1ba150 (patch)
tree6dbcce6592973358ef4bf6341888b0bbbdb98cc5 /cli/lsp/config.rs
parente0b9c745c15720914f14996bf357d5b375e2dbd8 (diff)
refactor(permissions): split up Descriptor into Allow, Deny, and Query (#25508)
This makes the permission system more versatile.
Diffstat (limited to 'cli/lsp/config.rs')
-rw-r--r--cli/lsp/config.rs24
1 files changed, 11 insertions, 13 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs
index c5d064285..f69cae435 100644
--- a/cli/lsp/config.rs
+++ b/cli/lsp/config.rs
@@ -37,7 +37,6 @@ use deno_lint::linter::LintConfig as DenoLintConfig;
use deno_npm::npm_rc::ResolvedNpmRc;
use deno_package_json::PackageJsonCache;
use deno_runtime::deno_node::PackageJson;
-use deno_runtime::deno_permissions::PermissionsContainer;
use deno_runtime::fs_util::specifier_to_file_path;
use indexmap::IndexSet;
use lsp_types::ClientCapabilities;
@@ -1509,17 +1508,16 @@ impl ConfigData {
ConfigWatchedFileType::ImportMap,
);
// spawn due to the lsp's `Send` requirement
- let fetch_result = deno_core::unsync::spawn({
- let file_fetcher = file_fetcher.cloned().unwrap();
- let import_map_url = import_map_url.clone();
- async move {
- file_fetcher
- .fetch(&import_map_url, &PermissionsContainer::allow_all())
- .await
- }
- })
- .await
- .unwrap();
+ let fetch_result =
+ deno_core::unsync::spawn({
+ let file_fetcher = file_fetcher.cloned().unwrap();
+ let import_map_url = import_map_url.clone();
+ async move {
+ file_fetcher.fetch_bypass_permissions(&import_map_url).await
+ }
+ })
+ .await
+ .unwrap();
let value_result = fetch_result.and_then(|f| {
serde_json::from_slice::<Value>(&f.source).map_err(|e| e.into())
@@ -1558,7 +1556,7 @@ impl ConfigData {
let file_fetcher = file_fetcher.clone().unwrap();
async move {
let file = file_fetcher
- .fetch(&specifier, &PermissionsContainer::allow_all())
+ .fetch_bypass_permissions(&specifier)
.await?
.into_text_decoded()?;
Ok(file.source.to_string())