diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-03-29 16:25:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-29 16:25:48 -0400 |
commit | 89bbbd102c6050763105be39a49494a5ffdce35b (patch) | |
tree | c0b912058a193d12fc60fac91223e0fef9fc7637 /cli/lsp/diagnostics.rs | |
parent | bacbf949256e32ca84e7f11c0171db7d9a644b44 (diff) |
refactor(lsp): remove boolean parameters on `documents.documents(...)` (#18493)
I think this makes things clearer at the call sites.
Diffstat (limited to 'cli/lsp/diagnostics.rs')
-rw-r--r-- | cli/lsp/diagnostics.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs index a9274801a..8ba8ce074 100644 --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -6,6 +6,7 @@ use super::client::Client; use super::config::ConfigSnapshot; use super::documents; use super::documents::Document; +use super::documents::DocumentsFilter; use super::language_server; use super::language_server::StateSnapshot; use super::performance::Performance; @@ -454,7 +455,9 @@ async fn generate_lint_diagnostics( lint_options: &LintOptions, token: CancellationToken, ) -> DiagnosticVec { - let documents = snapshot.documents.documents(true, true); + let documents = snapshot + .documents + .documents(DocumentsFilter::OpenDiagnosable); let workspace_settings = config.settings.workspace.clone(); let lint_rules = get_configured_rules(lint_options.rules.clone()); let mut diagnostics_vec = Vec::new(); @@ -530,7 +533,7 @@ async fn generate_ts_diagnostics( let mut diagnostics_vec = Vec::new(); let specifiers = snapshot .documents - .documents(true, true) + .documents(DocumentsFilter::OpenDiagnosable) .into_iter() .map(|d| d.specifier().clone()); let (enabled_specifiers, disabled_specifiers) = specifiers @@ -1025,7 +1028,10 @@ async fn generate_deno_diagnostics( ) -> DiagnosticVec { let mut diagnostics_vec = Vec::new(); - for document in snapshot.documents.documents(true, true) { + for document in snapshot + .documents + .documents(DocumentsFilter::OpenDiagnosable) + { if token.is_cancelled() { break; } |