I am trying to build a live template plugin for our framework's SDK. The thing is, these templates can differ between SDK versions, e.g. v1.0 can have different API for a button than v2.0. I managed to create a settings so that user can pick the version he likes:
The question is, how to accomplish dynamic live template registration based on the value provided. One way to do this would be using DefaultLiveTemplatesProvider and deal with registration logic there, but unfortunately, it is deprecated as of today in favor of
which is static and does not provide enough flexibility.
One possible solution I could come up with would be to make a custom TemplateContextType for each version and activate it based on current settings. This should work, but does not seem ideal. Any ideas on how to dynamically register live templates?