aboutsummaryrefslogtreecommitdiff
path: root/lib/src/lib.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-10-26 16:52:41 +0100
committerAkshay <[email protected]>2021-10-27 12:39:38 +0100
commitbfc720bf4d8adbb3b1eaff4f3556bc6d1e00849a (patch)
treed70767a31f3fb1978c2b2e932f7a83ea1eb87386 /lib/src/lib.rs
parent20d195988de1014517ff1a1c8c1041cff5f88e05 (diff)
allow stdin input to statix-singlevim-plugin
Diffstat (limited to 'lib/src/lib.rs')
-rw-r--r--lib/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
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 {
56 .flat_map(|d| Some(d.suggestion.as_ref()?.at)) 56 .flat_map(|d| Some(d.suggestion.as_ref()?.at))
57 .reduce(|acc, next| acc.cover(next)) 57 .reduce(|acc, next| acc.cover(next))
58 } 58 }
59 /// A range that encompasses all the diagnostics provided in this report
60 pub fn total_diagnostic_range(&self) -> Option<TextRange> {
61 self.diagnostics
62 .iter()
63 .flat_map(|d| Some(d.at))
64 .reduce(|acc, next| acc.cover(next))
65 }
59 /// Unsafe but handy replacement for above 66 /// Unsafe but handy replacement for above
60 pub fn range(&self) -> TextRange { 67 pub fn range(&self) -> TextRange {
61 self.total_suggestion_range().unwrap() 68 self.total_suggestion_range().unwrap()