2

I'm using scala twirl templating outside the play framework (using akka-http instead) for generating email bodies, but it seems like intelliJ has no idea how to parse the twirl files (they are basically plain text files).

I would love to see some autocomplete support, etc for twirl. Is there any good plugins for that? The Scala plugin is supposed to have support for play 2.0 which should include twirl, but it seems like it won't do anything without Play.

Ákos Vandra-Meyer
  • 1,890
  • 1
  • 23
  • 40
  • 1
    I'm using the latest version of IntelliJ Ultimate (2016.3), and even with Play, Twirl templates are not handled very well. You're not missing much. Personally, I despise Twirl, and I'd never use it again if I had a choice. – GreyBeardedGeek Jan 08 '17 at 18:03
  • Care to elaborate why you dislike Twirl so much? I'm not very invested yet, but it seemed the only sane choice for my use case. My reasons were mostly that it's type-safe, and I need to be able to generate *anything*, not only HTML. Also it comes pretty close to ERB, which I have used before. – Ákos Vandra-Meyer Jan 08 '17 at 23:08
  • What would you suggest to use instead of twirl? – Ákos Vandra-Meyer Jan 08 '17 at 23:10
  • For your use case, I'm not sure - maybe Scalate (https://github.com/scalate/scalate) with Moustache or ERB templates. For a "standard" web app, where the output is meant for a web browser, my default is to create a back-end API (REST-ish JSON), and a completely JavaScript front-end. Currently working with Angular 2 and TypeScript. – GreyBeardedGeek Jan 08 '17 at 23:21
  • Yeah, handling the web app part almost exactly like that, but I use scala.js for generating the js. Really cool. :) I'll look into scalate, but as far as I see, no IDE support there either. – Ákos Vandra-Meyer Jan 09 '17 at 08:46

0 Answers0