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§
Sourcefn extract_comments(
&self,
tree: &Tree,
source: &str,
file_path: &Path,
ast_nodes: &[NodeId],
) -> Result<Vec<ContentChunk>>
fn extract_comments( &self, tree: &Tree, source: &str, file_path: &Path, ast_nodes: &[NodeId], ) -> Result<Vec<ContentChunk>>
Extract comments from source code
Sourcefn comment_patterns(&self) -> &CommentPatterns
fn comment_patterns(&self) -> &CommentPatterns
Get the comment patterns for this language