Open abenz1267 opened 1 year ago
A method where plugins provide the prefix in PluginInfo
would work, but it would compromise on the freedom that plugins have to work in basically any way they want. This approach is a bit of a double edged sword, as it means that every plugin has to implement common elements like prefix matching themselves but I think the separation is best to be here.
A way to improve this (and a way to generally reduce code duplication) could be creating more macros/other helper code that could be feature gated in the anyrun-plugin
crate, for the plugins that have a "standard" approach.
Hi,
i noticed that while several plugins do have the option to have prefixes, Anyrun currently goes over all plugins configured anyways. As in:
Expected behaviour would be that you only get matches from plugins that have the prefix "!".
I've tried looking into this myself, but i'd need way more time as i don't fully grasp some Rust stuff for now.
I thought you might be able to provide a "quick" fix.
From what i gathered there needs to be a new
#[proc_macro_attribute]
... maybeget_prefix
.... that can be used to skip irrelevant plugins inmain.rs:870 refresh_matches
.What do you think? Maybe there's a better solution, i'm way not familar with Rust to determine that.
Regards