From bfc720bf4d8adbb3b1eaff4f3556bc6d1e00849a Mon Sep 17 00:00:00 2001
From: Akshay <nerdy@peppe.rs>
Date: Tue, 26 Oct 2021 21:22:41 +0530
Subject: allow stdin input to statix-single

---
 lib/src/lib.rs | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'lib/src')

diff --git a/lib/src/lib.rs b/lib/src/lib.rs
index 41e38c8..c2f24c6 100644
--- a/lib/src/lib.rs
+++ b/lib/src/lib.rs
@@ -56,6 +56,13 @@ impl Report {
             .flat_map(|d| Some(d.suggestion.as_ref()?.at))
             .reduce(|acc, next| acc.cover(next))
     }
+    /// A range that encompasses all the diagnostics provided in this report
+    pub fn total_diagnostic_range(&self) -> Option<TextRange> {
+        self.diagnostics
+            .iter()
+            .flat_map(|d| Some(d.at))
+            .reduce(|acc, next| acc.cover(next))
+    }
     /// Unsafe but handy replacement for above
     pub fn range(&self) -> TextRange {
         self.total_suggestion_range().unwrap()
-- 
cgit v1.2.3