cairo_lang_semantic::plugin

Trait AnalyzerPlugin

Source
pub trait AnalyzerPlugin:
    Debug
    + Sync
    + Send {
    // Required method
    fn diagnostics(
        &self,
        db: &dyn SemanticGroup,
        module_id: ModuleId,
    ) -> Vec<PluginDiagnostic>;

    // Provided method
    fn declared_allows(&self) -> Vec<String> { ... }
}
Expand description

A trait for an analyzer plugin: external plugin that generates additional diagnostics for modules.

Required Methods§

Source

fn diagnostics( &self, db: &dyn SemanticGroup, module_id: ModuleId, ) -> Vec<PluginDiagnostic>

Runs the plugin on a module.

Provided Methods§

Source

fn declared_allows(&self) -> Vec<String>

Allows this plugin supplies. Any allow the plugin supplies without declaring here are likely to cause a compilation error for unknown allow. If the plugin checks for patterns that you want to allow in some places, for example #[allow(some_pattern)] you will need to declare it here.

Implementors§