Skip to main content

AnalyzerPlugin

Trait AnalyzerPlugin 

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

    // 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<'db>( &self, db: &'db dyn Database, module_id: ModuleId<'db>, ) -> Vec<PluginDiagnostic<'db>>

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§