PowerShellEditorServices
PowerShellEditorServices copied to clipboard
Investigate source generators to improve some patterns
Dependency injection and "interface everything" can be very useful patterns but they also increase maintenance and debug complexity. Source generators can help by making references actually followable (DI) or reducing manual interface upkeep (interface everything).
For example:
https://github.com/DevTeam/Pure.DI
https://github.com/beakona/AutoInterface
Far from important though, marking up for grabs
Do you mean use this to generate the tie-ins to Omnisharp ABCs?
Do you mean use this to generate the tie-ins to Omnisharp ABCs?
So interface everything (I'm sure the pattern has an actual name but I dunno) is a pattern where you only take interfaces as much as possible because it makes mocking easier (well, possible).
So we have PsesInternalHost which is the main class handling all execution requests. But in most places we're actually taking IExecutionService (not the real name) which PsesInternalHost implements.
But every time you want to add a method to PsesInternalHost that something else uses, you also have to add it to IExecutionService. But there are no other IExecutionService implementations, it's just that one and only for testability.
So it'd be nice if instead of editing it in both places, we could just throw an attribute on whatever new method we're adding to PsesInternalHost that we want to use everywhere.