pub struct TodoParser { /* private fields */ }Expand description
Parser for detecting TODO-style tags in source code
Implementations§
Source§impl TodoParser
impl TodoParser
Sourcepub fn new(tags: &[String], case_sensitive: bool) -> Self
pub fn new(tags: &[String], case_sensitive: bool) -> Self
Create a new parser with the given tags
Sourcepub fn with_regex(
tags: &[String],
case_sensitive: bool,
custom_regex: Option<&str>,
) -> Self
pub fn with_regex( tags: &[String], case_sensitive: bool, custom_regex: Option<&str>, ) -> Self
Create a new parser with a custom regex pattern
The pattern should contain $TAGS as a placeholder which will be replaced
with the alternation of escaped tags (e.g., TODO|FIXME|BUG).
If no custom pattern is provided, the default pattern is used.
Sourcepub fn pattern_string(&self) -> Option<&str>
pub fn pattern_string(&self) -> Option<&str>
Get the regex pattern string for ripgrep integration
Sourcepub fn parse_line(&self, line: &str, line_number: usize) -> Option<TodoItem>
pub fn parse_line(&self, line: &str, line_number: usize) -> Option<TodoItem>
Parse a single line for TODO items
Sourcepub fn parse_content(&self, content: &str) -> Vec<TodoItem>
pub fn parse_content(&self, content: &str) -> Vec<TodoItem>
Parse content (multiple lines) for TODO items
Get the tags being searched for
Trait Implementations§
Source§impl Clone for TodoParser
impl Clone for TodoParser
Source§fn clone(&self) -> TodoParser
fn clone(&self) -> TodoParser
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TodoParser
impl RefUnwindSafe for TodoParser
impl Send for TodoParser
impl Sync for TodoParser
impl Unpin for TodoParser
impl UnwindSafe for TodoParser
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
Mutably borrows from an owned value. Read more