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§
Sourcefn supported_languages(&self) -> Vec<Language>
fn supported_languages(&self) -> Vec<Language>
Get supported languages
Sourcefn 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 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
Sourcefn 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 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.)
Sourcefn 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,
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