LanguageExtension

Trait LanguageExtension 

Source
pub trait LanguageExtension: Send + Sync {
    // Required methods
    fn supported_languages(&self) -> Vec<Language>;
    fn extract_dependencies<'life0, 'life1, 'async_trait>(
        &'life0 self,
        content: &'life1 str,
        language: Language,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_entrypoint<'life0, 'life1, 'async_trait>(
        &'life0 self,
        file_info: &'life1 FileInfo,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn extract_documentation<'life0, 'life1, 'async_trait>(
        &'life0 self,
        content: &'life1 str,
        language: Language,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<DocumentationBlock>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn priority(&self) -> u8 { ... }
}
Expand description

Trait for language-specific analysis extensions

Required Methods§

Source

fn supported_languages(&self) -> Vec<Language>

Get supported languages

Source

fn extract_dependencies<'life0, 'life1, 'async_trait>( &'life0 self, content: &'life1 str, language: Language, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Extract dependencies from file content

Source

fn is_entrypoint<'life0, 'life1, 'async_trait>( &'life0 self, file_info: &'life1 FileInfo, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Detect if file is an entrypoint (main, index, etc.)

Source

fn extract_documentation<'life0, 'life1, 'async_trait>( &'life0 self, content: &'life1 str, language: Language, ) -> Pin<Box<dyn Future<Output = Result<Vec<DocumentationBlock>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Extract documentation/comments

Provided Methods§

Source

fn priority(&self) -> u8

Get extension priority (higher = preferred for language)

Implementors§