From bf41c7847857c999d5641ffd4883e7c34ee031d4 Mon Sep 17 00:00:00 2001 From: Arend van Beelen jr Date: Sat, 19 Oct 2024 20:22:20 +0200 Subject: [PATCH] feat: plugin loader (#4234) --- crates/biome_plugin_loader/src/analyzer_plugin.rs | 8 ++++++++ crates/biome_plugin_loader/src/diagnostics.rs | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 crates/biome_plugin_loader/src/analyzer_plugin.rs diff --git a/crates/biome_plugin_loader/src/analyzer_plugin.rs b/crates/biome_plugin_loader/src/analyzer_plugin.rs new file mode 100644 index 000000000000..9f6a61027e5c --- /dev/null +++ b/crates/biome_plugin_loader/src/analyzer_plugin.rs @@ -0,0 +1,8 @@ +use biome_analyze::RuleDiagnostic; +use biome_parser::AnyParse; +use std::{fmt::Debug, path::PathBuf}; + +/// Definition of an analyzer plugin. +pub trait AnalyzerPlugin: Debug { + fn evaluate(&self, root: AnyParse, path: PathBuf) -> Vec; +} diff --git a/crates/biome_plugin_loader/src/diagnostics.rs b/crates/biome_plugin_loader/src/diagnostics.rs index a0229320c1f6..4deeee22207c 100644 --- a/crates/biome_plugin_loader/src/diagnostics.rs +++ b/crates/biome_plugin_loader/src/diagnostics.rs @@ -36,7 +36,6 @@ pub enum PluginDiagnostic { impl From for PluginDiagnostic { fn from(value: CompileError) -> Self { - println!("Compile Error: {value:?}"); PluginDiagnostic::Compile(CompileDiagnostic { source: Some(Error::from(value)), })