Plugins: Access to current sources before `InjectSourceEarly`
- 主要语言
- Go
- 星标
- 10.8k
- 派生
- 1.3k
- 平均合并
- 2 天 36 分钟
- 30 天内合并 PR
- 26
描述
I've run into an issue while creating a plugin.
My plugin needs to inject sources, however, it has to dynamically figure out what is missing from the current sources. This is an issue since the `InjectSourceEarly` method does not provide access to either the config or the current sources.
One way would have been to read the config at an earlier point, but the `EarlySourceInjector` plugins are the first to run.
### Suggestion
Have a `ConfigCompleter` or `ConfigExtender` hook for plugins to be able to read the config **before** any generation starts. The `MutateConfig` hook runs too late. Or maybe split `ConfigMutator` into `EarlyConfigMutator` and `LateConfigMutator`
OR
Pass the existing sources to the `EarlySourceInjector` and `LateSourceInjector` plugins. Plugin that needs to change what is injected based on what is already present would appreciate this.
贡献指南
评估
这个 Issue 还没有评估数据。