Skip to main content

BuiltinExtractor

Trait BuiltinExtractor 

Source
pub trait BuiltinExtractor: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn extensions(&self) -> &[&str];
    fn extract(&self, source: &str, file: &RelativePath) -> Vec<Annotation>;
}
Expand description

A built-in extractor that discovers annotations from source code.

Built-in extractors use tree-sitter for parsing and run in-process. They can be overridden by subprocess extractors in the manifest.

Required Methods§

Source

fn name(&self) -> &str

Unique name for this extractor (matches manifest name attribute).

Source

fn extensions(&self) -> &[&str]

File extensions this extractor applies to (including the dot).

Source

fn extract(&self, source: &str, file: &RelativePath) -> Vec<Annotation>

Extract annotations from source text.

Implementors§