fizzed / rocker

Java 8 optimized, memory efficient, speedy template engine producing statically typed, plain java objects
743 stars 90 forks source link

Default imports ? #124

Open albert-kam opened 4 years ago

albert-kam commented 4 years ago

I would like to import these into all of my templates without having to declare them manually.

@import com.fizzed.rocker.*
@import java.util.*
@import etc.*

And the list could grow overtime.

It would be nice to be a part of the options in rocker-compiler.conf, something like:

default.imports=com.fizzed.rocker.*, java.util.*
jjlauer commented 4 years ago

@albert-kam Another suggestion I had thought of as well when originally working on Rocker. I ended up not doing this since Java doesn't do it. However, I certainly could be persuaded the other way, that default imports are a good idea. If you were interested n a PR that implemented this, I'd be open to evaluating it!

bendem commented 4 years ago

My guess is that the problem is the lack of IDE integration. If the IDE was able to resolve and automatically add imports, it wouldn't be a problem, but since no one in the community with knowledge on how to maintain an IDE plugin has stepped up, people are looking for stop-gap solutions.

12 #97