rocker icon indicating copy to clipboard operation
rocker copied to clipboard

IDE support for templates

Open bjornbak opened this issue 10 years ago • 11 comments

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 avatar Jan 14 '16 18:01 bjornbak

@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.

jjlauer avatar Jan 14 '16 19:01 jjlauer

Any update on this? The engine looks very promising, but no IntelliJ-plugin is unfortunate.

tipsy avatar Jan 07 '17 12:01 tipsy

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 .

jjlauer avatar Jan 07 '17 16:01 jjlauer

@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

jjlauer avatar May 23 '17 13:05 jjlauer

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.

raderio avatar Oct 09 '17 14:10 raderio

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: Screenshot 2019-07-24 at 12 10 00 Screenshot 2019-07-24 at 13 01 33

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 avatar Jul 24 '19 10:07 bendem

@bendem nice , i like rocker but no idea support ,

iluoxuan avatar Aug 05 '19 09:08 iluoxuan

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: jte in IntelliJ

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.

casid avatar Jul 05 '20 05:07 casid