IntelliJ plugin for play

433 views
Skip to first unread message

Steve Chaloner

unread,
Dec 14, 2010, 7:46:36 PM12/14/10
to play-framework
I'm really disappointed by the lack of support for play in IntelliJ.
Damnit, someone should do something about that...

Plugin development starts tomorrow. I'm looking for wishlists,
comments on feature ports from the Eclipse plugin that people find
useful and - if anyone's interested - potential collaboration. I've
written a few plugins for IntelliJ - including IntelliJad, which seems
to be fairly popular, but needs updating for IntelliJ 10 - so
hopefully this isn't a dead-ended start :)

- Steve

Guillaume Bort

unread,
Dec 15, 2010, 4:33:40 AM12/15/10
to play-fr...@googlegroups.com
Hi,

Writing an IDE plugin is usually a nightmare. We've created one for
eclipse since it's the most used IDE.

But having a plugin for IntelliJ would be very nice. If you need any
help on the Play side just ask.

Thank you!

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>

--
Guillaume Bort, http://guillaume.bort.fr

For anything work-related, use g...@zenexity.fr; for everything else,
write guillau...@gmail.com

Marcello Bastéa-Forte

unread,
Dec 15, 2010, 10:18:29 AM12/15/10
to play-fr...@googlegroups.com
I've been using Play with IntelliJ with moderate success. My main limitations stem not so much from Play, but the Scala, Scalate, and SASS modules (though the latter is supported in ultimate by the Ruby plugin).

Perhaps I would use the standard Play Templating system more if it were supported in IntelliJ. Obviously being able to click on and refactor action names in templates would be useful. Same with static files referenced with @{'/public...'}. Then I suppose there's the small detail of presentational logic in templates...

I haven't used the Eclipse plugin (it's hard to go back to Eclipse), so I don't know what I'm missing there.

Marcello

Nicolas Martignole

unread,
Dec 15, 2010, 11:03:21 AM12/15/10
to play-fr...@googlegroups.com
Hi Steve

I started to work on a plugin for IDEA IntelliJ while I was at Devoxx,
but it's too complex for me. We talked with Netbeans guys at Devoxx
and they will add support for Play! soon.

So if you want to write a plugin for IDEA IntelliJ, I will be your first sponsor
and most interested user.

Here is a quick wishlist :
-> Navigate from the html page to the Controller
-> Provides a completion in the HTML template to automatically detect
    the controller/routes/methods

We don't really need start/stop play from idea, but this would be nice.

Let me know if you want a beta tester

Nicolas

2010/12/15 Marcello Bastéa-Forte <marc...@cellosoft.com>

Dorinel

unread,
Dec 15, 2010, 4:16:00 PM12/15/10
to play-framework
Template support is a must. Play templates must not be detected as
errors.
Also I would like navigation from method names in templates to method
definitions in Java code.
Thank you for starting this plugin.

Dallan

unread,
Dec 16, 2010, 12:37:00 PM12/16/10
to play-fr...@googlegroups.com
I'll also be a beta-tester.

-dallan

Wayne

unread,
Dec 16, 2010, 2:38:33 PM12/16/10
to play-fr...@googlegroups.com
I would also love to be a beta tester.

sas

unread,
Dec 17, 2010, 12:23:36 AM12/17/10
to play-framework
one more beta tester here

great to know that the netbeans guy are about to support play, all
these are great news

I also think that IDE templates support is one very needed feature...

Steve Chaloner

unread,
Dec 17, 2010, 7:37:08 AM12/17/10
to play-framework
The one issue with IntelliJ plugin development is that the Ultimate
Edition has a greater capability set than the Community edition. I'm
going to target both, but it's possible (haven't looked deeply enough
into the use cases yet) that the plugin will either be a)ultimate
only, or b) branched.

Which version are people here using?

BTW thanks for all the feature requests and offers of testing.

- Steve

Wayne

unread,
Dec 17, 2010, 2:59:14 PM12/17/10
to play-fr...@googlegroups.com
I am on IntelliJ 10 Community Edition. 

Working with Play, there is not much in the Ultimate Edition that really draws me in. But if I am missing out on something, let me know!

Steve Chaloner

unread,
Dec 17, 2010, 3:51:40 PM12/17/10
to play-framework

Brian Nesbitt

unread,
Dec 17, 2010, 10:00:36 PM12/17/10
to play-framework
IntelliJ 10 Community Edition here as well.

Nicolas Martignole

unread,
Dec 18, 2010, 6:13:55 AM12/18/10
to play-fr...@googlegroups.com
Hi Steve

I'm using the Ultimate edition.
For the plugin, my code is little crappy, since it was the first time I tried to write
a plugin. If you host your code on GitHub I'll be able to help/to contribute
if possible.
My GitHub id is "nicmarti", the Plugin is "PlaySmart" but if you look
at Git you will laugh : there's no files: :-| 
I only commited the root project in november,
I followed the tutorial on jetbrains wiki, I used the CE as explained
on their wiki. If we work on syntax highlight/navigation to controller
and method, I think both version will be supported easily. 

cheers

Nicolas

2010/12/18 Brian Nesbitt <br...@nesbot.com>
IntelliJ 10 Community Edition here as well.

Wayne

unread,
Apr 28, 2011, 10:06:48 AM4/28/11
to play-fr...@googlegroups.com
Hi Steve, did you make any progress with this? Would really like to unlock some of the potential of Play using IntelliJ, but the lack of IntelliJ support currently is disappointing. I think this plugin would be a huge boost (especially as it is a cross platform IDE and Free).

Wayne

tunggad

unread,
Apr 28, 2011, 11:01:38 AM4/28/11
to play-framework
Yeahh! with such a good framework support of IntelliJ IDEA as for
Grails we would have a ultimate boost of productivity.

My wishlist:
- syntax highlight + autocomplete for play view and template
- autocomplete for model data when coding on views
- jump back from model data on views to controllers code
- syntax highlight + autocomplete for tax name + tax attributes
- autocomplete for datas of all implicit injected objects in a
template/view (errors, flash, session, params etc.)
- syntax highlight and autocomplete when editing routes
- syntax highlight and autocomplete (Controller, Actions, Named
Routes) when editing Actions @{...} and @@{...}
- jump into used templates/tags when editing view/template
- autocomplete for Domain.findAllBy("someCreterianXYZ") when editing
"someCreterianXYZ"

Manuel Bernhardt

unread,
Apr 28, 2011, 12:59:11 PM4/28/11
to play-fr...@googlegroups.com
hi,

I started working on the custom language part of a plugin for IDEA for
Play a while ago after talking with Steve, but haven't been able to
continue to work on it recently due to -- you guessed it -- lack of
time.

The IDEA language plugin is not too well documented, I got some help
on the forums, but it's still quite a maze plus you have to implement
the lexer and parser and post-processor by hand using the IDEA API (in
comparison to eclipse where you can just throw in a extended BNF
grammar et voilà, you have a shiny editor).

If there's anyone out here who already implemented a custom language
plugin in IDEA please ping me.
Or if you know a language plugin for IDEA that also mixes different
languages in one view (e.g. Play! mixes HTML, Play! markup and groovy)
AND has its source code available, that would also help a lot.
Unfortunately the examples of e.g. FreeMarker and Velocity support
aren't open-source so no way to look at the source there.

Cheers!

Manuel

v6ak

unread,
Apr 28, 2011, 3:14:10 PM4/28/11
to play-framework
I know that at least Scala plugin (see
http://confluence.jetbrains.net/display/SCA/How+to+build+Scala+plugin+for+IntelliJ+IDEA+from+scratch
) does so. It can embed Java regexp. But I'm not sure if it is really
done by language embeding.

There is an RegExp error report: http://img6.imagebanana.com/img/1xr8i31q/plochu1_092.png


I'm also looking forward the plugin. I've the Community Edition.

I hope it will work well with Scala projects, too. It probably does
not require anything Scala-specific, maybe except some templates.

Steve Chaloner

unread,
Apr 29, 2011, 4:05:39 AM4/29/11
to play-framework
Been insanely busy for the last few months (work, [buying a/moving]
house, starting a new company, reviewing the upcoming Play cookbook,
etc) but things are starting to calm down and I'll have time to work
on this again. I've got some code sketched out that I need to commit,
and will catch up with Manuel to see where he's at.

- Steve

metrixon

unread,
May 6, 2011, 1:57:10 AM5/6/11
to play-framework
I'm also extremely interested in a descent Play! plugin / Play!
support in IDEA.
I am using the Ultimate Edition and since I'm using the Japid module,
I'm currently looking into writing a plugin for the Japid template
language.
Since in Japid all the variables need to be declared and the used
types imported, IDE support should be quite possible and very
powerful. But since I'm new to plugin development, I haven't made much
progress on this - actually I'm in a similar situation as Manuel. I've
started work on a multi PSI file type that uses JetBrains HTMLLanguage
and some custom code for the Japid syntax - but the last part is quite
difficult due to the fact that you need to create a custom lexer as
was already described above.

Before I came across this thread, I already created a ticket in
Jetbrains's issue tracker asking for official support for the Play!
framework. However, nobody knows if this is going to be implemented,
since Play! is not well known in comparison to things like Grails
(though I think it should be :-)).
So it is a bit difficult right now - on the one hand, I would
recommend to vote on the issue in JetBrain's tracker at
http://youtrack.jetbrains.net/issue/IDEA-69224 because the more people
vote on it, the bigger the chance that JetBrains will implement it. On
the other hand I don't want to discourage anyone working already on
such a plugin. In fact, if a plugin would be developed on something
like github, I would certainly try to help implement it.

- Christian

Manuel Bernhardt

unread,
May 6, 2011, 6:00:07 AM5/6/11
to play-fr...@googlegroups.com
Hi Christian and all,

quick reply as I am quite loaded -- I meant to reply on your post on
the IntellIJ forum as well, but no time yet.

- I am probably not going to vote on the JetBrains issue because that
would be somewhat self-defeating :) Also, from the JetBrains
perspective, if there's guys like us that start developing a plugin,
they probably won't start to write their own (unless we are terribly
slow) if they can get that for free from us and by providing some help
here and there. Personally I started looking into this because I
really want to have tooling for refactoring, lookups, etc. for IDEA,
and I want it yesterday.

- thanks to Dominik I got in touch with the JetBrain guys, esp. with
Peter who developed the Grails plugin. The Play templating engine
language and GSP is very, very similar - I think about everything but
#{some.Tag some:value} can be seen as a groovy expression (and even
there it really is only the "some.Tag" part that is Play-specific). In
practice this means there's not much work to do with Play templating
"language" lexing & parsing. However, the hard part is to glue
together all the languages (HTML, Groovy, Play) which does involve
writing a two-step lexer and a parser. Actually I'm quite ok with the
lexing and parsing, the "only" problem is that the "gluing" part
involves quite some unknown / undocumented APIs and this will probably
make it time-consuming (I haven't started with that yet).

- I know there's quite a number of alternative templating engines to
the default groovy one, yet I will focus on developing support for
that one because this is the one I use / need support for, and also
because it looks like the more stable to me (in terms of maintenance,
documentation, support, ...) - that being said I only very quickly
looked at alternatives so I don't really know what else there is.
However, I would suggest that we try to have one plugin that supports
several templating engines instead of multiple ones, because ideally
the IDEA plugin should also provide support for common functionality
such as importing Play! projects (resolving the classpath etc.) --
e.g. "play idealize" is broken for scala and does not look too easy to
fix (we talked about it with Julien), and this is annoying.

- what I have written until now is at
https://github.com/manuelbernhardt/play-idea under Apache 2 (mind you,
it's a stub). Steve also imported what he started at
https://github.com/schaloner/IdeaPlay, that is I have the feeling that
I am somewhat further now in terms of setting up the language support.
Before we each start making different repositories I suggest we settle
for one, I will selfishly propose to use mine here to whomever would
like to contribute.

- again, I am quite loaded, so I can't promise to do anything fast.
I'll do my best to move forward with the language part, maybe someone
else wants to give a shot to the other things such as Play facet
implementation / Play SDK support, project import etc. ?

Cheers!

Manuel

metrixon

unread,
May 6, 2011, 3:00:28 PM5/6/11
to play-framework
Hi Manuel,

thanks for your opinion on the matter. After all, we all agree that a
good support in IDEA would make Play! absolutely awesome.
I also agree that one single Play! plugin with support for different
template engines is the way to go instead of having multiple plugins
that only cover smaller parts.
I'm not sure JetBrains will pick up the idea of an official Play!
plugin and therefore, I will definitely take a look at the github
sources you mentioned.

- Christian


On May 6, 12:00 pm, Manuel Bernhardt <bernhardt.man...@gmail.com>
wrote:
> - what I have written until now is athttps://github.com/manuelbernhardt/play-ideaunder Apache 2 (mind you,
> it's a stub). Steve also imported what he started athttps://github.com/schaloner/IdeaPlay, that is I have the feeling that
> I am somewhat further now in terms of setting up the language support.
> Before we each start making different repositories I suggest we settle
> for one, I will selfishly propose to use mine here to whomever would
> like to contribute.
>
> - again, I am quite loaded, so I can't promise to do anything fast.
> I'll do my best to move forward with the language part, maybe someone
> else wants to give a shot to the other things such as Play facet
> implementation / Play SDK support, project import etc. ?
>
> Cheers!
>
> ManuelOn Fri, May 6, 2011 at 7:57 AM, metrixon <metri...@gmail.com> wrote:
> > I'm also extremely interested in a descent Play! plugin / Play!
> > support in IDEA.
> > I am using the Ultimate Edition and since I'm using the Japid module,
> > I'm currently looking into writing a plugin for the Japid template
> > language.
> > Since in Japid all the variables need to be declared and the used
> > types imported, IDE support should be quite possible and very
> > powerful. But since I'm new to plugin development, I haven't made much
> > progress on this - actually I'm in a similar situation as Manuel. I've
> > started work on a multi PSI file type that uses JetBrains HTMLLanguage
> > and some custom code for the Japid syntax - but the last part is quite
> > difficult due to the fact that you need to create a custom lexer as
> > was already described above.
>
> > Before I came across this thread, I already created a ticket in
> > Jetbrains's issue tracker asking for official support for the Play!
> > framework. However, nobody knows if this is going to be implemented,
> > since Play! is not well known in comparison to things like Grails
> > (though I think it should be :-)).
> > So it is a bit difficult right now - on the one hand, I would
> > recommend to vote on the issue in JetBrain's tracker at
> >http://youtrack.jetbrains.net/issue/IDEA-69224because the more people

v6ak

unread,
May 6, 2011, 3:25:39 PM5/6/11
to play-framework
I'm not sure that 'play idealize' is broken for Scala, although some
small workarounds are needed.

Regards,
Vít Šesták 'v6ak'

On May 6, 12:00 pm, Manuel Bernhardt <bernhardt.man...@gmail.com>
wrote:
> - what I have written until now is athttps://github.com/manuelbernhardt/play-ideaunder Apache 2 (mind you,
> it's a stub). Steve also imported what he started athttps://github.com/schaloner/IdeaPlay, that is I have the feeling that
> >http://youtrack.jetbrains.net/issue/IDEA-69224because the more people

Manuel Bernhardt

unread,
May 7, 2011, 10:41:09 AM5/7/11
to play-fr...@googlegroups.com
Hi,

On Fri, May 6, 2011 at 9:25 PM, v6ak <v6...@volny.cz> wrote:
> I'm not sure that 'play idealize' is broken for Scala, although some
> small workarounds are needed.

what I meant with broken is that you won't get the scala libraries
(the scala library of the current scala version, the play-scala
library, and the scala module src/ directory if I am not mistaken)
appended in the generated IML file. I agree that it is not that much
work to do it by hand, but it breaks the nice flow of "type one simple
command and get started right away" feeling that makes Play so nice to
use.

v6ak

unread,
May 7, 2011, 3:06:41 PM5/7/11
to play-framework
If you add it as the Maven dependency (maybe as a transitive
dependency of a Scala library - SQueryL, lift-json, ...), it works.
But I agree that it is not convenient.

Regards,
Vít Šesták 'v6ak'

On May 7, 4:41 pm, Manuel Bernhardt <bernhardt.man...@gmail.com>
wrote:
> Hi,
>
> On Fri, May 6, 2011 at 9:25 PM, v6ak <v...@volny.cz> wrote:
> > I'm not sure that 'play idealize' is broken for Scala, although some
> > small workarounds are needed.
>
> what I meant with broken is that you won't get the scala libraries
> (the scala library of the current scala version, the play-scala
> library, and the scala module src/ directory if I am not mistaken)
> appended in the generated IML file. I agree that it is not that much
> work to do it by hand, but it breaks the nice flow of "type one simple
> command and get started right away" feeling that makes Play so nice to
> >> - what I have written until now is athttps://github.com/manuelbernhardt/play-ideaunderApache 2 (mind you,
> >> >http://youtrack.jetbrains.net/issue/IDEA-69224becausethe more people

sas

unread,
May 8, 2011, 12:16:52 PM5/8/11
to play-framework
I've just voted up on this issue...

On May 6, 2:57 am, metrixon <metri...@gmail.com> wrote:
> I'm also extremely interested in a descent Play! plugin / Play!
> support in IDEA.
> I am using the Ultimate Edition and since I'm using the Japid module,
> I'm currently looking into writing a plugin for the Japid template
> language.
> Since in Japid all the variables need to be declared and the used
> types imported, IDE support should be quite possible and very
> powerful. But since I'm new to plugin development, I haven't made much
> progress on this - actually I'm in a similar situation as Manuel. I've
> started work on a multi PSI file type that uses JetBrains HTMLLanguage
> and some custom code for the Japid syntax - but the last part is quite
> difficult due to the fact that you need to create a custom lexer as
> was already described above.
>
> Before I came across this thread, I already created a ticket in
> Jetbrains's issue tracker asking for official support for the Play!
> framework. However, nobody knows if this is going to be implemented,
> since Play! is not well known in comparison to things like Grails
> (though I think it should be :-)).
> So it is a bit difficult right now - on the one hand, I would
> recommend to vote on the issue in JetBrain's tracker athttp://youtrack.jetbrains.net/issue/IDEA-69224because the more people

Erwan Loisant

unread,
May 9, 2011, 4:49:36 AM5/9/11
to play-fr...@googlegroups.com
Hi,

First of all thanks for starting the work on the Intellij plugin -
it's a great initiative.

1) Regarding the plugin itself: I tried it but I failed to compile it
(in the import "com.intellij.extapi.psi.PsiFileBase;" it doesn't find
"com.intellij.extapi"). Do I need to install a specific Intellij
plugin?

2) For play idealize: it's fixed in play-scala's trunk, you can
replace the commands.py file on your local copy to fix it.
https://github.com/playframework/play-scala/blob/master/commands.py

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>

--
Erwan Loisant

Manuel Bernhardt

unread,
May 9, 2011, 7:28:52 AM5/9/11
to play-fr...@googlegroups.com
Hi,

> 1) Regarding the plugin itself: I tried it but I failed to compile it
> (in the import "com.intellij.extapi.psi.PsiFileBase;" it doesn't find
> "com.intellij.extapi"). Do I need to install a specific Intellij
> plugin?

You need to have the JFlex plugin installed, in order to compile the
lexer. But this error looks more like you don't have the correct
libraries, i.e. you need to have the IDEA source code locally checked
out and linked from the project / configured as SDK. I suggest you
follow http://confluence.jetbrains.net/display/IDEADEV/Getting+Started+with+Plugin+Development
and more specifically
http://www.jetbrains.org/pages/viewpage.action?pageId=983225

Note that the plugin is for IDEA X and so far I only have experience
with it using the ultimate edition.

> 2) For play idealize: it's fixed in play-scala's trunk, you can
> replace the commands.py file on your local copy to fix it.
> https://github.com/playframework/play-scala/blob/master/commands.py

Good to know, I'll check that out!

Manuel

andy petrella

unread,
Oct 22, 2011, 8:12:04 AM10/22/11
to play-fr...@googlegroups.com
FYI,

This work has started and some preview is available over here http://blogs.jetbrains.com/idea/2011/10/play-with-intellij-idea-eap-build-110187/

best

andy

Steven Elliott Jr

unread,
Oct 24, 2011, 9:35:28 AM10/24/11
to play-fr...@googlegroups.com
This is excellent! I have been waiting for this for a long time now..

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/e8F9BV57WvUJ.
Reply all
Reply to author
Forward
0 new messages