diff options
author | Akshay <[email protected]> | 2021-10-27 12:40:42 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-10-27 12:43:23 +0100 |
commit | f909b20c540ea99dddfd04b8439ee35b8dd703b8 (patch) | |
tree | cc9a60108f975419bf2621262739071a5f0a1be6 /lib/src | |
parent | ed1ee66b06add4c22e4922ffa762f097355c7431 (diff) |
allow stdin input to statix-single, vim pluginv0.2.2
Diffstat (limited to 'lib/src')
-rw-r--r-- | lib/src/lib.rs | 7 |
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() |