I'm injection a custom language into YAML. For the custom language I have created a formatter which works fine when the language is not injected but resides in its own file. When injected, everything works as expected except for the getSpacing method. This is called with the 2 child blocks which are now no longer the blocks of the custom language but:
YamlInjectedLanguageBlockWrapper a private inner class of YamlInjectedLanguageBlockBuilder.
The Spacing is calculated with SpacingBuilder.getSpacing(@NotNull Block parent, @Nullable Block child1, @NotNull Block child2) for which I've created a whole set of patterns to calculate the spacing. The problem is that the blocks are now wrapped so none of the patterns match. I can see from the debugger that the YamlInjectedLanguageBlockWrapper contains a reference to the wrapped block but since it's all in private inner classes there is no nice way for me to access this runtime. I have it working with reflection but I would prefer to have some public interface available to perform the unwrapping.
Any ideas / suggetions?