summaryrefslogtreecommitdiff
path: root/cli/lsp/documents.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2023-09-13 17:30:27 +0100
committerGitHub <noreply@github.com>2023-09-13 17:30:27 +0100
commit022664aab4ff5e1a9ec6257781f464f56da7a357 (patch)
tree6d3fa4ae1519d1e09c46629ca1eb07ac324acc62 /cli/lsp/documents.rs
parent109a42ab0728d4e3e2429fd090eb2f432a6fc9f5 (diff)
feat(lsp): WorkspaceSettings::disablePaths (#20475)
Diffstat (limited to 'cli/lsp/documents.rs')
-rw-r--r--cli/lsp/documents.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs
index 388f9f2e5..e601147ff 100644
--- a/cli/lsp/documents.rs
+++ b/cli/lsp/documents.rs
@@ -804,6 +804,7 @@ impl FileSystemDocuments {
pub struct UpdateDocumentConfigOptions<'a> {
pub enabled_urls: Vec<Url>,
+ pub disabled_urls: Vec<Url>,
pub document_preload_limit: usize,
pub maybe_import_map: Option<Arc<import_map::ImportMap>>,
pub maybe_config_file: Option<&'a ConfigFile>,
@@ -1283,14 +1284,10 @@ impl Documents {
.filter_map(|url| specifier_to_file_path(url).ok())
.collect(),
options
- .maybe_config_file
- .and_then(|cf| {
- cf.to_files_config()
- .ok()
- .flatten()
- .map(|files| files.exclude)
- })
- .unwrap_or_default(),
+ .disabled_urls
+ .iter()
+ .filter_map(|url| specifier_to_file_path(url).ok())
+ .collect(),
options.document_preload_limit,
);
self.resolver_config_hash = new_resolver_config_hash;
@@ -2032,6 +2029,7 @@ console.log(b, "hello deno");
documents.update_config(UpdateDocumentConfigOptions {
enabled_urls: vec![],
+ disabled_urls: vec![],
document_preload_limit: 1_000,
maybe_import_map: Some(Arc::new(import_map)),
maybe_config_file: None,
@@ -2073,6 +2071,7 @@ console.log(b, "hello deno");
documents.update_config(UpdateDocumentConfigOptions {
enabled_urls: vec![],
+ disabled_urls: vec![],
document_preload_limit: 1_000,
maybe_import_map: Some(Arc::new(import_map)),
maybe_config_file: None,