pub struct ContextDetector;Expand description
Context detector that analyzes file content to determine context.
Implementations§
Source§impl ContextDetector
impl ContextDetector
Sourcepub fn detect_context(
&self,
file_path: &str,
content: &str,
line_number: usize,
) -> ContentContext
pub fn detect_context( &self, file_path: &str, content: &str, line_number: usize, ) -> ContentContext
Detect the context of content at a specific line in a file.
Sourcepub fn is_documentation_file(&self, file_path: &str) -> bool
pub fn is_documentation_file(&self, file_path: &str) -> bool
Check if a file is a documentation file.
Sourcepub fn is_yaml_file(&self, file_path: &str) -> bool
pub fn is_yaml_file(&self, file_path: &str) -> bool
Check if a file is a YAML file.
Sourcepub fn is_json_file(&self, file_path: &str) -> bool
pub fn is_json_file(&self, file_path: &str) -> bool
Check if a file is a JSON file.
Sourcepub fn is_in_markdown_code_block(
&self,
content: &str,
line_number: usize,
) -> bool
pub fn is_in_markdown_code_block( &self, content: &str, line_number: usize, ) -> bool
Check if a line is inside a Markdown code block.
Sourcepub fn is_in_yaml_description(&self, content: &str, line_number: usize) -> bool
pub fn is_in_yaml_description(&self, content: &str, line_number: usize) -> bool
Check if a line is in a YAML description/comment field.
Sourcepub fn is_in_json_string_value(&self, content: &str, line_number: usize) -> bool
pub fn is_in_json_string_value(&self, content: &str, line_number: usize) -> bool
Check if a line is in a JSON string value.
Sourcepub fn is_in_comment(&self, content: &str, line_number: usize) -> bool
pub fn is_in_comment(&self, content: &str, line_number: usize) -> bool
Check if a line is inside a comment.
Sourcepub fn should_reduce_confidence(&self, context: ContentContext) -> bool
pub fn should_reduce_confidence(&self, context: ContentContext) -> bool
Determine if findings in this context should have reduced confidence.
Trait Implementations§
Source§impl Debug for ContextDetector
impl Debug for ContextDetector
Source§impl Default for ContextDetector
impl Default for ContextDetector
Source§fn default() -> ContextDetector
fn default() -> ContextDetector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ContextDetector
impl RefUnwindSafe for ContextDetector
impl Send for ContextDetector
impl Sync for ContextDetector
impl Unpin for ContextDetector
impl UnwindSafe for ContextDetector
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