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§
sourcefn diagnostics(
&self,
db: &dyn SemanticGroup,
module_id: ModuleId,
) -> Vec<PluginDiagnostic>
fn diagnostics( &self, db: &dyn SemanticGroup, module_id: ModuleId, ) -> Vec<PluginDiagnostic>
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.