feat: module periority

This commit is contained in:
iff 2024-12-08 22:56:43 +01:00
parent 03904775f5
commit c1e575c32a
9 changed files with 27 additions and 18 deletions

View file

@ -17,10 +17,12 @@
There are 2 types of modules:
- **Standard module**: Will always run to retrieve suggestions
- Naming convention: `_pay-respects-module-<your module name>`
- Naming convention: `_pay-respects-module-<priority>-<your module name>`
- **Fallback module**: Will only be run if no previous suggestion were found
- **CAUTION**: Will immediately return if a suggestion is obtained, and there is no guaranteed the modules are executed in a specific order.
- Naming convention: `_pay-respects-fallback-<your module name>`
- **CAUTION**: Will immediately return if a suggestion is obtained
- Naming convention: `_pay-respects-fallback-<priority>-<your module name>`
Priority is used to retrieve suggestions in a specific order by an [unstable sort](https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable) (although they will always be after compile-time matches). Default modules have a priority of `100`.
When running your module, you will get the following environment variables: