Skip to main content

extract_comments

Function extract_comments 

Source
pub fn extract_comments(source: &str) -> Vec<Trivia>
Expand description

Extract trivia from source text by scanning for comments.

This is a standalone function that doesn’t require the lexer to be in CST mode. It scans the source text and returns all comments found, with their spans. This is useful for tools that need to extract comments from already-parsed source.