Trait LanguageCommentExtractor

Source
pub trait LanguageCommentExtractor: Send + Sync {
    // Required methods
    fn extract_comments(
        &self,
        tree: &Tree,
        source: &str,
        file_path: &Path,
        ast_nodes: &[NodeId],
    ) -> Result<Vec<ContentChunk>>;
    fn comment_patterns(&self) -> &CommentPatterns;
}
Expand description

Trait for language-specific comment extraction

Required Methods§

Source

fn extract_comments( &self, tree: &Tree, source: &str, file_path: &Path, ast_nodes: &[NodeId], ) -> Result<Vec<ContentChunk>>

Extract comments from source code

Source

fn comment_patterns(&self) -> &CommentPatterns

Get the comment patterns for this language

Implementors§