IDE support for templates
Hi,
I'm very impressed about the performance of rocker but another thing is important to become a great template engine - IDE support..
Do you have a plugin for any of the major IDEs? Or plans for creating one?
I am an IntelliJ fan and would of course prefer support for that...
@bjornbak IDE support would obviously be amazing -- but not exactly a trivial problem. The project is relatively new so no IDE support at the moment. If you wanted to give intellij a stab, I'd say go for it! The compiler generates a very usable Model object you could build a template engine with.
Any update on this? The engine looks very promising, but no IntelliJ-plugin is unfortunate.
It's a common request for IDE support. I won't be able to invest the time in building one anytime in the near future, so I'm hoping someone in the opensource community could help.
Would be happy to help advise someone who was interested.
On Sat, Jan 7, 2017 at 7:28 AM, David [email protected] wrote:
Any update on this? The engine looks very promising, but no IntelliJ-plugin is unfortunate.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fizzed/rocker/issues/12#issuecomment-271080845, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjwAp14x1yfcqmOtske7-ygPRbiyA-fks5rP4UKgaJpZM4HFH9a .
@tipsy @bjornbak We're trying to gauge interest in an IDE plugin for rocker templates (that would include code completion). If interested please take a few seconds to fill out this survey: https://www.surveymonkey.com/r/VKXYG8P
We need to push in Spring Boot direction https://github.com/fizzed/rocker/issues/66 If Rocker will be popular, it will be by default in Spring Boot, so Jetbrains itself will make a plugin.
I have been trying to whip up something to provide syntax highlighting for rocker in intellij but I'm clearly out of my league. I've tried using https://github.com/antlr/antlr4-intellij-adaptor/ and came up with this:

I'm sure someone with a basic understanding of how antlr works (not my case) would get to something actually usable in a few hours/days.
The implementation can probably be heavily inspired by pebble's plugin: https://github.com/bjansen/pebble-intellij
Source: https://github.com/bendem/rocker-intellij-plugin
@bendem nice , i like rocker but no idea support ,
Due to my frustration with JSP at work, I've written jte during lockdown - a small template engine that has pretty much full IntelliJ support for code suggestions, refactorings and highlighting. The language takes a very similar approach as Rocker does, so the jte IntelliJ plugin might be a blueprint for a Rocker IntelliJ plugin.
In case you're curious, here is a gif showing the plugin in action:

The key part of the plugin is org.jusecase.jte.intellij.language.JteJavaLanguageInjector extending com.intellij.lang.injection.MultiHostInjector, which basically injects the various Java parts of the template in a Java class that IntelliJ understands.