Bug 252696 - [plan] [itd] [jdt-weaving] [completion] Content assist should include declarations from ITDs
Summary: [plan] [itd] [jdt-weaving] [completion] Content assist should include declara...
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.6.4   Edit
Assignee: Andrew Eisenberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 252624
Blocks: 74419 258577
  Show dependency tree
 
Reported: 2008-10-29 18:18 EDT by Andrew Eisenberg CLA
Modified: 2009-05-15 14:17 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eisenberg CLA 2008-10-29 18:18:08 EDT
Content assist should include declarations from ITDs.  If not, these declarations are effectively invisible to programmers.
Comment 1 Andrew Eisenberg CLA 2008-10-29 18:25:45 EDT
The key to this is the class org.eclipse.ajdt.core.codeconversion.AspectsConvertingParser.

This class converts aspectj code to similar, but syntactically correct Java code.  In addition to transforming AspectJ code to syntactically correct java, I can enhance the code by adding all ITD declarations into it.

This requires ensuring that method, field, and constructor ITDs are inserted properly.  I also need to ensure that super classes and super interfaces are correct.
Comment 2 Andrew Eisenberg CLA 2008-10-29 18:29:10 EDT
I am able to modify the AspectsConvertingParser to add ITD and declare parents information at the proper locations when the type is top-level.  Still having issues with inner types.  We don't have to worry about anonymous types since (by being anonymous) they cannot have ITDs.

The difficult part will be finding out all the correct type information.  Currently, the AspectJ model isn't rich enough to provide fully qualified type information about ITDs.
Comment 3 Andrew Eisenberg CLA 2008-10-29 18:37:37 EDT
Another issue is that we can only get AspectJ control over content assist if the assist is running in an AJCompilationUnit (not CompilationUnit).  This means that only files with .aj extensions in AspectJ editors will be able to do this.

I wonder what the ramifications of making everything in a .aj editor use AJCompilationUnits...
Comment 4 Andrew Eisenberg CLA 2008-10-31 15:06:17 EDT
I started working on this and made some partial progress.  as described in #3.  But, I am running into walls where I also need to really fix reconciling before I can continue.  See Bug 252624.
Comment 5 Andrew Eisenberg CLA 2008-11-11 19:22:05 EST
A first pass of this functionality has been committed along with most of the code for implementing bug 252624.  See that bug for a longer description of what I implemented to get the below working.

Here is what works:
1. ITD constructors, fields, and methods for the current type are present
2. Methods/fields from ITD super types are present
3. Methods/fields ITD-ed on super types are present
4. Methods/fields ITD-ed on ITD super types are present
5. Methogs/fields ITD-ed on fields/local variables/method returns are present

This seems to be a fairly complete list, but I am not yet confident that it works in all situations.  I haven't written many tests for this yet (my next task).

Content assist inside ITDs is not working.
Comment 6 Andrew Eisenberg CLA 2008-11-19 13:16:56 EST
Making good progress...

I have lots of tests committed.

I have now fixed content assist inside of ITDs.
Comment 7 Andrew Eisenberg CLA 2008-12-11 19:37:21 EST
Closing this bug.  Content assist in .aj files is ITD-aware.  Need to do the same for .java files.  

The follow up is in bug 258577
Comment 8 Andrew Eisenberg CLA 2009-01-06 18:27:08 EST
Should be closed