Priority
Normal
Type
Feature 
State
In Progress 
Assignee
Roman Shevchenko 
Subsystem
Editor. Code Completion 
Affected versions
Fix for
  • Submitted by   Chris Herron
    8 months ago (22 Dec 2009 18:43)
  • Updated by   Vasiliy Tegza
    2 days and 10 hours ago (03 Sep 2010 20:52)
IDEA-26959 Add Code Completion For AspectJ ITDs
78

Links (show as list)

I've been exploring Spring Roo which makes heavy use of AspectJ ITDs (Inter Type Declarations). ITDs are in use elsewhere also - e.g. Apache Magma.

Opening a Spring Roo-managed codebase in IntelliJ presents immediate problems in terms of code-completion and error highlighting. Roo's use of ITDs means that many class members that would be available at runtime after compilation/weaving are not available to IntelliJ's class metadata. For example, in Roo, ITDs are created for things like JPA entities. Class companion .aj files contain member definitions such as property getters & setters, an ID field, and JPA finder methods. There is more information in Ben Alex's Roo architecture overview.

ITD .aj files are well-formed and contain inlined Java code - they look quite straightforward to parse and augment the corresponding class metadata. The Eclipse AspectJ plugin, and SpringSource's STS support ITD's, so there may be reusable code if their licensing is appropriate.

I hope JetBrains will add this feature which would be highly complimentary to IntelliJ IDEA's existing inline Aspect editing and Spring AOP support.
Comments (49)
 
History
 
Linked Issues (1)
 
Andy Clement
  Andy Clement
23 Dec 2009 01:26
(8 months ago)
Just to lend my support. I'm Andy Clement, the project lead for the AspectJ project. SpringSource has received many requests from IntelliJ users for more complete ITD support within IntelliJ (so they can use the new Spring Roo project). If I can help at all - let me know. If you need to know more about the format of intertype declarations, we can discuss that. As Chris suggests, their basic syntax is relatively straightforward although their generic form is a little complicated. If you wish to discuss the AspectJ model that exists after an AspectJ build (which includes the AST for parsed aspects and a relationship map describing which types were affected by ITDs), we can do that too. The AspectJ compiler is developed as an standaline project that can be slotted into any IDE wishing to provide AOP support. Over the last few months the compiler interface has been enhanced to improve the way it can tie into IDEs and offer a more responsive incremental compilation story. I will say the interface is rather ill defined right now (consisting of some interfaces over here and some over there...), but if we need to formalize what the interface really is, or even open up AspectJ further to ease its ability to be embedded/invoked, we can look at doing that too.

As Chris mentions, we may be able to exploit some code that already exists in AJDT for parsing ITD structures - Andrew Eisenberg (responsible for AJDT) would be able to help with that. And finally, there may actually be a subset of the full ITD functionality which would be enough for Roo, and Ben Alex (Spring Roo project lead) would be able to help us determine what that precise subset is.
Mattias Jiderhamn
  Mattias Jiderhamn
28 Dec 2009 10:32
(8 months ago)
Developer of the AspectJ weaving plugin here.

It should be noted that currently the plugin weaves (adds aspects to) the classes after they have been compiled by the normal (JDK/Eclipse/Jikes) compiler. For ITD to be properly supported, classes would need to be compiled by the AspectJ compiler.

At the initial development of the plugin (for IntelliJ 4.5) I couldn't find a way to replace the project compiler. Possibly it's easier to add plugin compilers with later versions of IntelliJ and I'm willing to look at that, however pointers are welcome since time is limited.
Bjorn Harvold
  Bjorn Harvold
12 Jan 2010 21:07
(7 months ago)
I am voting for this functionality to be in the next version of IntelliJ.
Nick Collins
  Nick Collins
14 Jan 2010 15:32
(7 months ago)
<Comment was deleted>
Ken Rimple
  Ken Rimple
14 Jan 2010 19:21
(7 months ago)
I'd prefer this is delivered as a plugin update if at all possible, and that we don't wait until the next major IntelliJ version.
Craig Day
  Craig Day
20 Jan 2010 07:16
(7 months ago)
Its got my vote. Was impressed with ROO when I saw it and then was immediately depressed when I realized that IDEA didn't support ITD. Another case of IDEA lacking relevant framework support (e.g. JavaFX). p.s. couldn't find the "Vote" functionality in YouTrack???
Gordon
  Gordon
01 Feb 2010 15:46
(7 months ago)
Could it be a part of an interim release (such as 9.0.2)? If so, then that would be fine, if not, I would also prefer the plugin.
Scott Murphy
  Scott Murphy
03 Feb 2010 21:45
(7 months ago)
+1 Vote! I am stuck with memory hungry Eclipse right now until this is completed.
Tommy Holm
  Tommy Holm
12 Feb 2010 14:04
(6 months ago)
+1 vote. ROO is great, ROO and IntelliJ is even greater :) It would hate to switch to another IDE but I really like ROO, so please add support for it.
Gandalf Hudlow
  Gandalf Hudlow
26 Feb 2010 07:34
(6 months ago)
Yes please, roo support in intellij would be AWESOME!
Usha
  Usha
03 Mar 2010 00:04
(6 months ago)
I vote for it. Working with Roo is great but I dont like to be tied down to Eclipse, so please provide support in Intellij.
Richard Attermeyer
  Richard Attermeyer
03 Mar 2010 11:47
(6 months ago)
+1 vote. roo is great and I would like to continue working inside one IDE
Stefan Scheidt
  Stefan Scheidt
03 Mar 2010 11:52
(6 months ago)
Another +1 vote for ITD support in _the_ IDE. Mainly to support Roo.
Alexander Pavlov
  Alexander Pavlov
03 Mar 2010 22:34
(6 months ago)
Another +1. Would not mind to pay for a plugin.
yahoo530216254
  yahoo530216254
08 Mar 2010 20:23
(5 months ago)
Another +1
Jon Todd
  Jon Todd
09 Mar 2010 21:34
(5 months ago)
+1 for this feature
Mary Wong
  Mary Wong
18 Mar 2010 20:39
(5 months ago)
add my +1
Paul Chen
  Paul Chen
18 Mar 2010 20:51
(5 months ago)
+1 vote.
Han Wang
  Han Wang
18 Mar 2010 20:51
(5 months ago)
+1 for me. Can't wait to use IntelliJ for Roo, or just about EVERYTHING !
Jeremy Rosenberg
  Jeremy Rosenberg
19 Mar 2010 19:49
(5 months ago)
+1
Venkat Sonnathi
  Venkat Sonnathi
20 Mar 2010 05:10
(5 months ago)
Please click on the number above to register your vote. Just saying +1 does not increment the count.
Nabeel Ali Memon
  Nabeel Ali Memon
20 Mar 2010 22:37
(5 months ago)
Would like to hear from Jetbrains guys about an estimated release time for this functionality. Dmitry Jemerov said we'll be able to get this functionality in some 9.x release here http://www.jetbrains.net/devnet/message/5253094;jsessionid=ED685D8B82A4F9D0B3CFA452126F8B4A it's 9.2 coming up and i don't see this youtrack issue addressed in the EAP release notes. Hope this will be addressed sooner.
Roman Shevchenko
  Roman Shevchenko
22 Mar 2010 16:53
(5 months ago)
Initial version of AspectJ plugin added to the repository; requires latest Maia EAP (94.585).
Nabeel Ali Memon
  Nabeel Ali Memon
22 Mar 2010 17:06
(5 months ago)
Now that is an awesome news
Wesley Hall
  Wesley Hall
22 Mar 2010 19:41
(5 months ago)
Brilliant, just did a little basic testing and it works like a charm.... now I can really get down to playing with this Roo stuff... Great work Idea guys! :)
Simon Dyson
  Simon Dyson
23 Mar 2010 01:04
(5 months ago)
Working great! Good riddance to Eclipse!
Nils Wloka
  Nils Wloka
23 Mar 2010 11:14
(5 months ago)
I copied the plugin JAR to the plugin directory, started my freshly installed 94.585, created a project from the ten-minutes example, but unfortunately wasn't able to get the plugin to do anything. Are there any special steps required to activate the ITD support?

UPDATE: Thanks to Roman, I have been able to resolve the issue. There was an old file type association that made IntelliJ interpret *.aj as text files. Moving it manually to AspectJ files under "Settings -> File Types" did the trick.
Simon Dyson
  Simon Dyson
23 Mar 2010 16:40
(5 months ago)
Does the plugin show up in the installed plugins settings?
Roman Shevchenko
  Roman Shevchenko
13 Apr 2010 16:17
(4 months ago)
AspectJ plugin updated to 0.2; support for Ajc compiler added (Settings - Compiler - Java Compiler).
Nabeel Ali Memon
  Nabeel Ali Memon
13 Apr 2010 16:28
(4 months ago)
Is push-in refactoring available? Can't find it.
Roman Shevchenko
  Roman Shevchenko
13 Apr 2010 16:36
(4 months ago)
Nabeel, not yet. Feel free to create feature request (project IntelliJ IDEA, subsystem AspectJ).
Nabeel Ali Memon
  Nabeel Ali Memon
15 Apr 2010 16:02
(4 months ago)
An issue has been created to support push-in refactoring (IDEA-53928) to support better Spring Roo development experience. Interested guys are requested to vote.
Tomasz Chorwat
  Tomasz Chorwat
30 Apr 2010 13:01
(4 months ago)
+1
Nabeel Ali Memon
  Nabeel Ali Memon
30 Apr 2010 13:59
(4 months ago)
Intellij idea 9.0.2 alongwith AspectJ support plugin makes AspectJ ITD's code-completion support available. We now need Push-in refactoring support which becomes essential while working with Spring Roo. So people, please vote for IDEA-53928.
Mattias Jiderhamn
  Mattias Jiderhamn
30 Apr 2010 22:26
(4 months ago)
I would just like to point out that the AspectJ support plugin uses the same directory name as the existing AspectJ Weaver which has caused trouble for existing users. I have changed the directory name of the AspectJ Weaver but there have been cases where this plugin needs to be removed and re-installed in order to work together with AspectJ support plugin.
Reji
  Reji
06 May 2010 19:30
(3 months ago)
+1
Roman Shevchenko
  Roman Shevchenko
12 May 2010 19:46
(3 months ago)
@Mattias Sorry about that. But as AspectJ support plugin is going to supersede AspectJ Weaver's functionality this may be justified.
Alex Quezada
  Alex Quezada
25 May 2010 21:26
(3 months ago)
Running Junit tests that use ITDs does not work yet with this plugin (using 0.3 of plugin with Maia 95.146). Either you'd need to be able to run tests in an .aj file, or "see" the test from the referenced test .java file. All the test debugging goodness of Idea is lost otherwise. But great work, I can say that Roo support alone may be enough to convince my group to purchase licenses.
Roman Shevchenko
  Roman Shevchenko
26 May 2010 23:32
(3 months ago)
@Alex you can run JUnit tests from .aj in 0.3 – but one by one only. To run them all at once execute target class. Debugging support is planned of course – watch/vote for IDEA-54710.
Alex Quezada
  Alex Quezada
26 May 2010 23:53
(3 months ago)
Thanks Roman, but that's what I tried... I get java.lang.Exception: No tests found matching Method testCountBases when running from .aj file. When running from .java file, it just runs the markerMethod test (which doesn't do anything)
Roman Shevchenko
  Roman Shevchenko
26 May 2010 23:58
(3 months ago)
@Alex Looks like test class wasn't weaved. Please make sure that Ajc compiler is selected in Settings | Compiler | Java Compiler, then rebuild project.
Alex Quezada
  Alex Quezada
27 May 2010 02:26
(3 months ago)
Ah yes, that took care of that, but now I get this:
java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)
Searched around for this, but only found a solution for Eclipse: http://javatech.org/tag/roo/
Any idea on how to do this in Idea (no pun intended)? Should we move this to a support forum entry?
Roman Shevchenko
  Roman Shevchenko
27 May 2010 16:47
(3 months ago)
@Alex at the moment Ajc compiler doesn't perform weaving steps required for Spring. Until it fixed you can use Maven targets.
Thomas von Siebenthal
  Thomas von Siebenthal
10 Jun 2010 13:26
(2 months ago)
+1
peter chiu
  peter chiu
25 Jul 2010 10:46
(6 weeks ago)
+1
Nabeel Ali Memon
  Nabeel Ali Memon
15 Aug 2010 17:14
(3 weeks ago)
Any chance we could get Aspectj statement support with Idea X or Aspectj support plugin?
Roman Shevchenko
  Roman Shevchenko
16 Aug 2010 11:38
(2 weeks ago)
@Nabeel Chances are. If you file an issue you'll be notified immediately :)
Nabeel Ali Memon
  Nabeel Ali Memon
16 Aug 2010 12:51
(2 weeks ago)
@Roman Thanks. I din't know this issue is strictly limited to ITD's support only. Any ways i've created another issue IDEA-57644 about first class AOP development support concerns. Everybody is requested to vote in order to have AOP support in Intellij Idea as excellent as Java support is.
Sébastien Arbogast
  Sébastien Arbogast
17 Aug 2010 22:02
(2 weeks ago)
+1
Vasiliy Tegza
  Vasiliy Tegza
03 Sep 2010 20:52
(2 days and 10 hours ago)
+1