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§
Sourcefn diagnostics<'db>(
&self,
db: &'db dyn Database,
module_id: ModuleId<'db>,
) -> Vec<PluginDiagnostic<'db>>
fn diagnostics<'db>( &self, db: &'db dyn Database, module_id: ModuleId<'db>, ) -> Vec<PluginDiagnostic<'db>>
Runs the plugin on a module.
Provided Methods§
Sourcefn declared_allows(&self) -> Vec<String>
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.
Sourcefn plugin_type_id(&self) -> TypeId
fn plugin_type_id(&self) -> TypeId
A TypeId of the plugin, used to compare the concrete types
of plugins given as trait objects.