From 763f05e74dfd0032b238603f625893a52e363591 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 25 Jul 2024 09:07:59 -0400 Subject: fix(unstable): move sloppy-import warnings to lint rule (#24710) Adds a new `no-sloppy-imports` lint rule and cleans up the lint code. Closes #22844 Closes https://github.com/denoland/deno_lint/issues/1293 --- tests/util/server/src/lsp.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests/util/server/src') diff --git a/tests/util/server/src/lsp.rs b/tests/util/server/src/lsp.rs index f21035610..b615ed475 100644 --- a/tests/util/server/src/lsp.rs +++ b/tests/util/server/src/lsp.rs @@ -1230,6 +1230,16 @@ impl CollectedDiagnostics { .collect() } + pub fn for_file(&self, specifier: &Url) -> Vec { + self + .all_messages() + .iter() + .filter(|p| p.uri == *specifier) + .flat_map(|p| p.diagnostics.iter()) + .cloned() + .collect() + } + /// Gets the messages that the editor will see after all the publishes. pub fn all_messages(&self) -> Vec { self.0.clone() @@ -1245,7 +1255,7 @@ impl CollectedDiagnostics { .find(|p| { p.diagnostics .iter() - .any(|d| d.source == Some(source.to_string())) + .any(|d| d.source.as_deref() == Some(source)) }) .map(ToOwned::to_owned) .unwrap() -- cgit v1.2.3