pub struct IgnoreParser;Expand description
Parses lang-check-disable / lang-check-enable / lang-check-disable-next-line
and lang-check-begin / lang-check-end directives from document text.
Implementations§
Source§impl IgnoreParser
impl IgnoreParser
Sourcepub fn parse_directives(text: &str) -> Vec<IgnoreDirective>
pub fn parse_directives(text: &str) -> Vec<IgnoreDirective>
Parse all ignore directives from the given text.
Sourcepub fn resolve(text: &str, directives: &[IgnoreDirective]) -> Vec<IgnoreRange>
pub fn resolve(text: &str, directives: &[IgnoreDirective]) -> Vec<IgnoreRange>
Resolve parsed directives into concrete byte ranges that should be ignored.
Sourcepub fn should_ignore(diagnostic: &Diagnostic, ranges: &[IgnoreRange]) -> bool
pub fn should_ignore(diagnostic: &Diagnostic, ranges: &[IgnoreRange]) -> bool
Check whether a diagnostic should be suppressed by any of the ignore ranges.
Sourcepub fn parse(text: &str) -> Vec<IgnoreRange>
pub fn parse(text: &str) -> Vec<IgnoreRange>
Parse all directives and resolve to ranges in one step.
Sourcepub fn resolve_all(
text: &str,
directives: &[IgnoreDirective],
) -> ResolvedDirectives
pub fn resolve_all( text: &str, directives: &[IgnoreDirective], ) -> ResolvedDirectives
Resolve all directives into both legacy ignore ranges and scoped regions.
Sourcepub fn block_regions(text: &str) -> Vec<Range<usize>>
pub fn block_regions(text: &str) -> Vec<Range<usize>>
Resolve Begin/End directives into DirectiveRegion entries.
Byte ranges of lang-check-begin block … lang-check-end regions,
within which prose blocks are force-merged for continuation checking.
Sourcepub fn should_ignore_by_region(
diagnostic: &Diagnostic,
text: &str,
regions: &[DirectiveRegion],
) -> bool
pub fn should_ignore_by_region( diagnostic: &Diagnostic, text: &str, regions: &[DirectiveRegion], ) -> bool
Check whether a diagnostic should be suppressed by any directive region.
Regions with only a language override (no rule_ids) do NOT suppress;
they are language-override-only regions.
Auto Trait Implementations§
impl Freeze for IgnoreParser
impl RefUnwindSafe for IgnoreParser
impl Send for IgnoreParser
impl Sync for IgnoreParser
impl Unpin for IgnoreParser
impl UnsafeUnpin for IgnoreParser
impl UnwindSafe for IgnoreParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more