summaryrefslogtreecommitdiff
path: root/cli/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp')
-rw-r--r--cli/lsp/registries.rs12
-rw-r--r--cli/lsp/testing/execution.rs6
2 files changed, 11 insertions, 7 deletions
diff --git a/cli/lsp/registries.rs b/cli/lsp/registries.rs
index 81e2552c0..c8e5dad60 100644
--- a/cli/lsp/registries.rs
+++ b/cli/lsp/registries.rs
@@ -30,7 +30,7 @@ use deno_core::url::Url;
use deno_core::ModuleSpecifier;
use deno_graph::Dependency;
use deno_runtime::deno_web::BlobStore;
-use deno_runtime::permissions::Permissions;
+use deno_runtime::permissions::PermissionsContainer;
use log::error;
use once_cell::sync::Lazy;
use regex::Regex;
@@ -519,7 +519,7 @@ impl ModuleRegistry {
.file_fetcher
.fetch_with_accept(
specifier,
- &mut Permissions::allow_all(),
+ PermissionsContainer::allow_all(),
Some("application/vnd.deno.reg.v2+json, application/vnd.deno.reg.v1+json;q=0.9, application/json;q=0.8"),
)
.await;
@@ -617,7 +617,7 @@ impl ModuleRegistry {
.ok()?;
let file = self
.file_fetcher
- .fetch(&endpoint, &mut Permissions::allow_all())
+ .fetch(&endpoint, PermissionsContainer::allow_all())
.await
.ok()?;
let documentation: lsp::Documentation =
@@ -973,7 +973,7 @@ impl ModuleRegistry {
let specifier = Url::parse(url).ok()?;
let file = self
.file_fetcher
- .fetch(&specifier, &mut Permissions::allow_all())
+ .fetch(&specifier, PermissionsContainer::allow_all())
.await
.ok()?;
serde_json::from_str(&file.source).ok()
@@ -1030,7 +1030,7 @@ impl ModuleRegistry {
let specifier = ModuleSpecifier::parse(url).ok()?;
let file = self
.file_fetcher
- .fetch(&specifier, &mut Permissions::allow_all())
+ .fetch(&specifier, PermissionsContainer::allow_all())
.await
.map_err(|err| {
error!(
@@ -1066,7 +1066,7 @@ impl ModuleRegistry {
.ok()?;
let file = self
.file_fetcher
- .fetch(&specifier, &mut Permissions::allow_all())
+ .fetch(&specifier, PermissionsContainer::allow_all())
.await
.map_err(|err| {
error!(
diff --git a/cli/lsp/testing/execution.rs b/cli/lsp/testing/execution.rs
index 722f06e2c..a498df857 100644
--- a/cli/lsp/testing/execution.rs
+++ b/cli/lsp/testing/execution.rs
@@ -30,6 +30,7 @@ use deno_core::ModuleSpecifier;
use deno_runtime::ops::io::Stdio;
use deno_runtime::ops::io::StdioPipe;
use deno_runtime::permissions::Permissions;
+use deno_runtime::permissions::PermissionsContainer;
use deno_runtime::tokio_util::run_local;
use indexmap::IndexMap;
use std::collections::HashMap;
@@ -162,7 +163,7 @@ async fn test_specifier(
let mut worker = create_main_worker_for_test_or_bench(
&ps,
specifier.clone(),
- permissions,
+ PermissionsContainer::new(permissions),
vec![ops::testing::init(sender, fail_fast_tracker, filter)],
Stdio {
stdin: StdioPipe::Inherit,
@@ -254,6 +255,9 @@ impl TestRun {
lsp_log!("Executing test run with arguments: {}", args.join(" "));
let flags = flags_from_vec(args.into_iter().map(String::from).collect())?;
let ps = proc_state::ProcState::build(flags).await?;
+ // Various test files should not share the same permissions in terms of
+ // `PermissionsContainer` - otherwise granting/revoking permissions in one
+ // file would have impact on other files, which is undesirable.
let permissions =
Permissions::from_options(&ps.options.permissions_options())?;
test::check_specifiers(