Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@import should be valid before the template signature #60

Closed
Lasering opened this issue Dec 19, 2014 · 9 comments
Closed

@import should be valid before the template signature #60

Lasering opened this issue Dec 19, 2014 · 9 comments

Comments

@Lasering
Copy link

If @import was valid before the template signature one could have this:

@import org.some.example.package.Customer

@(customer: Customer, orders: List[Order])

<h1>Welcome @customer.name!</h1>
<ul>
@for(order <- orders) {
  <li>@order.title</li>
}
</ul>

Instead of this:

@(customer: org.some.example.package.Customer, orders: List[Order])

@import org.some.example.package.Customer

<h1>Welcome @customer.name!</h1>
<ul>
@for(order <- orders) {
  <li>@order.title</li>
}
</ul>
@kflorence
Copy link

+1 it would be nice to maintain imports at the top

@pvlugter
Copy link
Contributor

This was added some time ago. See #1 and #12. Is it not working?

@Lasering
Copy link
Author

I've searched for it but did not found it. I guess I didn't search very well. Sorry for making you waste your time.

@kflorence
Copy link

@pvlugter is there an easy way to tell which version of Play this got into?

@kflorence
Copy link

@kflorence
Copy link

Created playframework/playframework#3821

@pvlugter
Copy link
Contributor

The commit that added top imports is in twirl 1.0.+. Available in Play 2.3 and 2.4 milestones.

fd35a33

git tag --contains fd35a3338141734f14e77ada3ced19e7f9062f2f
v1.0.0
v1.0.0-RC1
v1.0.0-RC2
v1.0.0-RC3
v1.0.1
v1.0.2
v1.0.3
v1.0.4

@kflorence
Copy link

Hmm, @pvlugter in that case the problem I'm seeing might be related to the Scala IDEA plugin (having @import at the top seems to compile fine, but it breaks syntax highlighting in IDEA).

@kflorence
Copy link

@pvlugter this seems to be the case, and looks like there is already a ticket for it: https://youtrack.jetbrains.com/issue/SCL-8030 (sorry for time wasted, sometimes it's hard to tell where these problems lie).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants