Project
IntelliJ IDEA
Priority
Normal
Type
Feature
Fix versions
10.0 (99.18)
State
Fixed
Assignee
Roman Shevchenko
Subsystem
Editor. Code Completion
Affected versions
9.0
Fixed in build
98.248  
  • Created by   Chris Herron
    2 years ago (22 Dec 2009 19:43)
  • Updated by   Dmitry Jemerov
    15 months ago (29 Oct 2010 01:10)
 
IDEA-26959 Add Code Completion For AspectJ ITDs
89
Issue is visible to: All Users
  The issue is visible to the selected user group only
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 (58)
 
History
 
Linked Issues (?)
 
Andy Clement
  Andy Clement
23 Dec 2009 02:26
2 years 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 11:32
2 years 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 22:07
2 years ago
I am voting for this functionality to be in the next version of IntelliJ.
Nick Collins
  Nick Collins
14 Jan 2010 16:32
2 years ago
<Comment was deleted>
Ken Rimple
  Ken Rimple
14 Jan 2010 20:21
2 years 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 08:16
2 years 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 16:46
2 years 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 22:45
2 years ago
+1 Vote! I am stuck with memory hungry Eclipse right now until this is completed.
Tommy Holm
  Tommy Holm
12 Feb 2010 15:04
23 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 08:34
23 months ago
Yes please, roo support in intellij would be AWESOME!
Usha
  Usha
03 Mar 2010 01:04
23 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 12:47
23 months ago
+1 vote. roo is great and I would like to continue working inside one IDE
Stefan Scheidt
  Stefan Scheidt
03 Mar 2010 12:52
23 months ago
Another +1 vote for ITD support in _the_ IDE. Mainly to support Roo.
Alexander Pavlov
  Alexander Pavlov
03 Mar 2010 23:34
23 months ago
Another +1. Would not mind to pay for a plugin.
yahoo530216254
  yahoo530216254
08 Mar 2010 21:23
23 months ago
Another +1
Jon Todd
  Jon Todd
09 Mar 2010 22:34
23 months ago
+1 for this feature
Mary Wong
  Mary Wong
18 Mar 2010 21:39
22 months ago
add my +1
Paul Chen
  Paul Chen
18 Mar 2010 21:51
22 months ago
+1 vote.
Han Wang
  Han Wang
18 Mar 2010 21:51
22 months ago
+1 for me. Can't wait to use IntelliJ for Roo, or just about EVERYTHING !
Jeremy Rosenberg
  Jeremy Rosenberg
19 Mar 2010 20:49
22 months ago
+1
Venkat Sonnathi
  Venkat Sonnathi
20 Mar 2010 06:10
22 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 23:37
22 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 17:53
22 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 18:06
22 months ago
Now that is an awesome news
Wesley Hall
  Wesley Hall
22 Mar 2010 20:41
22 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 02:04
22 months ago
Working great! Good riddance to Eclipse!
Nils Wloka
  Nils Wloka
23 Mar 2010 12:14
22 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 17:40
22 months ago
Does the plugin show up in the installed plugins settings?
Roman Shevchenko
  Roman Shevchenko
13 Apr 2010 17:17
21 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 17:28
21 months ago
Is push-in refactoring available? Can't find it.
Roman Shevchenko
  Roman Shevchenko
13 Apr 2010 17:36
21 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 17:02
21 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 14:01
21 months ago
+1
Nabeel Ali Memon
  Nabeel Ali Memon
30 Apr 2010 14:59
21 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 23:26
21 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 20:30
21 months ago
+1
Roman Shevchenko
  Roman Shevchenko
12 May 2010 20:46
20 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 22:26
20 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
27 May 2010 00:32
20 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
27 May 2010 00:53
20 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
27 May 2010 00:58
20 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 03:26
20 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 17:47
20 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 14:26
20 months ago
+1
peter chiu
  peter chiu
25 Jul 2010 11:46
18 months ago
+1
Nabeel Ali Memon
  Nabeel Ali Memon
15 Aug 2010 18:14
17 months ago
Any chance we could get Aspectj statement support with Idea X or Aspectj support plugin?
Roman Shevchenko
  Roman Shevchenko
16 Aug 2010 12:38
17 months ago
@Nabeel Chances are. If you file an issue you'll be notified immediately :)
Nabeel Ali Memon
  Nabeel Ali Memon
16 Aug 2010 13:51
17 months 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 23:02
17 months ago
+1
Vasiliy Tegza
  Vasiliy Tegza
03 Sep 2010 21:52
17 months ago
+1
Alexander Pavlov
  Alexander Pavlov
14 Sep 2010 02:40
16 months ago
After playing with Roo for some time I decided to take my vote back - your mileage may vary, but I see quite a few potential for Roo behind prototyping data models. As to AspectJ in general, while having its upport in Idea would be a good feature, I do not see convincing examples that would justify using AOP at levels exceeding standard Java EE features.
Roman Shevchenko
  Roman Shevchenko
28 Sep 2010 15:49
16 months ago
@Alexander Roo has a good potential for prototyping web-based UIs - and it definitely moves in that direction.
Matthew Morgan
  Matthew Morgan
14 Oct 2010 10:43
15 months ago
+1
Jim Bethancourt
  Jim Bethancourt
15 Oct 2010 18:40
15 months ago
+1
Eric Shoemaker
  Eric Shoemaker
15 Oct 2010 21:25
15 months ago
+1
Seshadri
  Seshadri
28 Oct 2010 14:27
15 months ago
+1 I would not mind to pay even if it is released as a separate plugin.
Dmitry Jemerov
  Dmitry Jemerov
28 Oct 2010 14:44
15 months ago
The AspectJ features used by Spring Roo are now fully supported in IntelliJ IDEA X.
Related Changes
Resolved Date
15 months ago (28 Oct 2010 14:44)
Type
ExceptionFeature
Fixed In version
<lost change>10.0 (99.18)
State
In ProgressFixed
Assignee
Roman Shevchenko (roman.shevchenko)Roman Shevchenko
Subsystem
<lost change>Editor. Code Completion
Affected versions
9.0
Fixed in build
No Fixed in build98.248
Affected version
<lost change>
Nabeel Ali Memon
  Nabeel Ali Memon
29 Oct 2010 00:42
15 months ago
@Dmitry That's an awesome news. Waiting for the next EAP build to try this. IDEA-53928 is also important for Spring-Roo projects' development and
IDEA-57644 is really important to have general AOP development capabilities(something many people prefer other ide's over IDEA for) in Intellij Idea. Will these both be fixed within upcoming EAP builds?
Dmitry Jemerov
  Dmitry Jemerov
29 Oct 2010 01:10
15 months ago
You don't need to wait for the next EAP; the plugin is in there for a few months already.