ilya.chernikov
09/21/2017, 8:11 AMKotlin Scripting part of the compiler settings, as in the screenshot by @mkobit above. Put FQN of the template class (B according to the snippet from @Gary Tierney) into Script template classes field, and classpath to load that class and its dependencies into Script templates classpath. You may need to reload the project for the changes to be recognised by Idea.
It is possible to write a plugin as well, based on the ScriptTemplatesProvider interface. But I wouldn’t recommend to go that route now. We are working on the improved scripting now, and these interfaces may change significantly in the near future, or even become obsolete. In particular we’re thinking about script templates discovery mechanisms based on the metadata.