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§
Sourcefn is_documentation_comment(
&self,
node: &Node<'_>,
parent: Option<Node<'_>>,
source: &str,
) -> Option<bool>
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 analyzeparent- The parent node (if any) for contextsource- The full source text
§Returns
Some(true)if this is definitely a documentation commentSome(false)if this is definitely a regular commentNoneif the default logic should be used