LanguageHandler

Trait LanguageHandler 

Source
pub trait LanguageHandler {
    // Required method
    fn is_documentation_comment(
        &self,
        node: &Node<'_>,
        parent: Option<Node<'_>>,
        source: &str,
    ) -> Option<bool>;
}
Expand description

Trait for language-specific comment handling

Required Methods§

Source

fn is_documentation_comment( &self, node: &Node<'_>, parent: Option<Node<'_>>, source: &str, ) -> Option<bool>

Check if a comment node should be treated as documentation

This allows languages to implement custom logic for distinguishing between regular comments and documentation comments based on context.

§Arguments
  • node - The comment node to analyze
  • parent - The parent node (if any) for context
  • source - The full source text
§Returns
  • Some(true) if this is definitely a documentation comment
  • Some(false) if this is definitely a regular comment
  • None if the default logic should be used

Implementors§