Trait AnalyzerPlugin

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

    // Provided methods
    fn declared_allows(&self) -> Vec<String> { ... }
    fn plugin_type_id(&self) -> TypeId { ... }
}
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.

Source

fn plugin_type_id(&self) -> TypeId

A TypeId of the plugin, used to compare the concrete types of plugins given as trait objects.

Implementors§