Alexander Ioffe
09/20/2024, 12:41 AMIvan Gomes
09/22/2024, 8:07 AMIvan Gomes
09/22/2024, 8:17 AMpublic inline fun TemplateScope.html(@Language("HTML") fragment: String): Unit = HtmlAppender(...).invoke(fragment)
where HtmlAppender is a subclass of InterpolatorIvan Gomes
09/22/2024, 8:42 AMhtml.invoke(...) instead of the prettier html(...), because it's the lesser evil compared to having loads of @Language("HTML") all over the place, at least in my use cases. really hope JetBrains fixes this so I don't have to choose.
ref. https://github.com/TwingineerHQ/ktemplar/commit/58e53366e3930c9d3826cfecb408edc7162ae9abIvan Gomes
09/22/2024, 8:45 AMAlexander Ioffe
09/23/2024, 1:06 AMAlexander Ioffe
09/23/2024, 1:07 AMfun MyConext.staticContextTerp(@Language("MyLanguage") str: String): Wrapped = Messages.throwPluginNotExecuted()
This way you won't need to use .invoke to get the @Language annotation to work.Alexander Ioffe
09/23/2024, 1:07 AMIvan Gomes
09/23/2024, 9:05 AMError transforming expression: Fatal Exception: The interpolator type InterpolatingAppender has no 2nd argument (i.e. the output-type)where my leaf object is
HtmlAppender -subclasses-> InterpolatingAppender -subclasses-> ProtoInterpolator<Any?, Unit> . I'm assuming it's not following the inheritance up, so I'm testing the theory by inlining InterpolatingAppenderIvan Gomes
09/23/2024, 9:18 AMProtoInterpolator<Any?, Unit> directly. side note that it is order sensitive in that the ProtoInterpolator subclassing has to be the first one, e.g. ProtoInterpolator<Any?, Unit>, InterpolatingAppender() but not InterpolatingAppender(), ProtoInterpolator<Any?, Unit>Ivan Gomes
09/23/2024, 9:44 AMhtml("<div>${data.someValue}</div>") form!
changeset: https://github.com/TwingineerHQ/ktemplar/commit/b1c28ba39fb134881b6548be5f7117c781d0a159Alexander Ioffe
09/23/2024, 4:24 PMIvan Gomes
09/23/2024, 4:50 PMCLOVIS
09/24/2024, 4:19 PMreally hope JetBrains fixes this so I don't have to choose.
The youtrack ticket was marked as in-progress today, so I'll probably be in the next release 🚀
Alexander Ioffe
09/25/2024, 12:00 PM