I think this is because the dependency injection resolves instances of explorer components differently depending on how they are specified in the class constructor:
Using the ResultProvider<ResultType> interface: this correctly resolves the registered instance with scoped lifetime, ie. the instance will not be duplicated.
Using the DistinctValuesComponent (or whatever) concrete implementation. This auto-resolves a new instance with transient lifetime, meaning a new component is created for each
Unfortunately there doesn't seem to be a way to define the default lifetime for auto-resolved types.
I will log a low-priority issue to create an analyzer to alert us to this (ie. make sure to use interfaces instead of concrete types in constructors for ExplorerComponent classes). It seems like this would be useful but I have no idea how much work this involves...
Multiple queries are sent for some analyses.
I think this is because the dependency injection resolves instances of explorer components differently depending on how they are specified in the class constructor:
ResultProvider<ResultType>
interface: this correctly resolves the registered instance withscoped
lifetime, ie. the instance will not be duplicated.DistinctValuesComponent
(or whatever) concrete implementation. This auto-resolves a new instance withtransient
lifetime, meaning a new component is created for eachUnfortunately there doesn't seem to be a way to define the default lifetime for auto-resolved types.
I will log a low-priority issue to create an analyzer to alert us to this (ie. make sure to use interfaces instead of concrete types in constructors for
ExplorerComponent
classes). It seems like this would be useful but I have no idea how much work this involves...