= AJDT Core work items

_Last updated: 2004-05-17 by acolyer_

This document details what needs to be done in ajdt.core and
shadows/org.eclipse.jdt.core to provide full integration with the eclipse
JDT model and to support AJDT.

== Unit testing

Determine how we can write efficient and comprehensive unit tests for all
that follows given the difficult swizzling etc. involved in creating a working
plugin.

== Builder integration

This work package enables the building of AspectJ projects in batch and
incremental mode, with problems found during compilation reported back to the
tasks view. It also supports management of the Aspectjrt.jar classpath variable
for AspectJ projects.

A new subclass of JavaBuilder, AspectJBuilder has been introduced. This
delegates to AjIncrementalImageBuilder and AjBatchImageBuilder to perform
builds.

. Basic builder support: Builds from source only, outputs to project
  specified output directories, problem reporting integration.

. Add support for inpath, outjar, aspectpath in building.
  This task depends on IAspectJProject and implementation being able to
  manage and persist AspectJ specific path elements (see xref:java-model-extension[]).
** batch mode
** incremental mode (requires delta processing)

. Aspectjrt classpath variable

== Reconciling  & structure building

This work package enables updating of structure based views as the contents of
an editor buffer is edited, and reporting of warnings and errors (early error
annotations) in the editor buffer.

When a CompilationUnit is asked to build its structure, it creates a
CompilationUnitStructureRequestor which is fed structure information by a
SourceElementParser (see 4). It also creates a new CompilationUnitProblemFinder
(Compiler subclass) and compiles the unit with it to detect any problems.

. Determine how to build AjCompilerAdapter for CompilationUnitProblemFinders
  (which are created outside of AspectJBuilder). This involves where and how
  BcelWorld etc. are managed for the project.

. As changes are made in an editor buffer, a CompilationUnitResolver continually
  compiles the source and reports problems. This is another compiler subclass, and
  we also need to determine how to build an AjCompilerAdapter for it.

[[java-model-extension]]
== Java Model Extension

This work package is a needed foundation for almost any UI function that works
with program structure or elements (e.g. to display AspectJ content in an
outline view).

This requires the creation of AspectJ element interfaces in the IJavaElement
hierarchy, and then corresponding classes that implement them.

. In the package org.aspectj.ajdt.core :

** IAspectJModelExtension (extends org.eclipse.jdt.core.IModelExtension)
** IAspectJElement   (root interface for aspectj elements)
** IAjType  (extends IType, adds isAspect() )
** IAspect (extends IAjType)
** IAdvice
** IPointcut
** IDeclareErrorOrWarning
** IDeclareParents
** IDeclareSoft
** IInterTypeField
** IInterTypeMethod
** IAspectJProject

. In the package org.aspectj.ajdt.internal.core, for each interface above,
  add SourceXXX and SourceXXXElementInfo classes.

. In the package org.aspectj.ajdt.core.jdom, add classes IDOMxxx for each
  interface in (1), plus implementation classes and SimpleDOMBuilder extension.

. In the package org.aspectj.ajdt.internal.compiler.env, add an
  IGenericXXX and ISourceXXX interface for each element in (1), which are
  implemented by the classes in (2).

== Source Element Parsing (Java Model creation)

This work package populates the structure model on which the outline views
etc. depend.

. Extend ISourceElementRequestor with AspectJ AST nodes

. Extend SourceElementParser to implement appropriate requestor callbacks

. The 5 implementors of ISourceElementRequestor need updating to do the
  appropriate thing with AspectJ elements:

** CompilationUnitStructureRequestor (for outline view etc.)
** SimpleDOMBuilder (used by portions of UI that generate code - refactoring? what else?)
** SourceElementRequestorAdapter
** SourceIndexRequestor (used by indexer, for searching and type hierarchy)
** SourceMapper (used when attaching source to a jar file)

. This seems to be the point at which we need to implement the
  IExtensionFactory so that we can cleanly create Aj versions of the above
  without polluting the JDT (see UI design of the same).

== DOM extensions

This work package enables the source code of an aspectJ program to be
modelled as a structured document. Which user-interface actions will be
broken without this? (Refactoring?)

. In the package org.aspectj.jdt.core.dom, add counterparts to the AspectJ nodes
  already defined in org.aspectj.internal.compiler.ast (not needed first time round?)
. Extend IDocumentElementRequestor interface
. Extend DocumentElementParser
. Extend DOMBuilder
. Extend DOMFactory
. Add CreateAspectJXxxOperation classes

== Code completion / code assist

This work package enables Ctrl+Space in an editor to offer completions on
pointcut names, aspect names, and inter-type declared methods and fields.

. Extend ICompletionRequestor interface
. Extend ICompletionRequestor implementors (there are 9, 7 of which are anonymous inner classes)
. Extend CompletionEngine with pointcut
. Extend ISelectionRequestor with pointcut
. Investigate changes to SelectionEngine
. Extend CompletionKeyword family
. Add CompletionOnPointcut
. Investigate changes to CompletionParser and CompletionScanner classes
. Investigate changes in AssistParser
. Extend keywords in 'impl' package
. Add SelectionOnxxx classes for AspectJ in 'select' package
. Investigate changes to SelectionParser and SelectionScanner

== Type Hierarchy

This work package enables the type hierarchy view to correctly display the
hierarchy for aspects.

. Override hierarchy methods in IAjType
. Extend ChangeCollector
. Extend TypeHierarchy
. Extend HierarchyBinaryType

== ".aj" File extension

This work package ensures that AJDT treats .java and .aj files as equivalent.

. update SuffixConstants class
. update Util class

== Java Model inclusion

This work package ensures that all types in pure Java projects are visible
inside the AspectJ model.

Extend model generation logic to look at project that have either the
AspectJ nature, OR the Java nature.

== Class formatting and dissassembling

This work package enables 'editing' of a .class file to present a view that
is aware of AspectJ elements (rather than seeing the generated aj-synthetic
stuff etc.).

(can be deferred for now)

. Make jdt.internal.compiler.classfmt aware of aj-synthetic
. Make "" understand aj-attributes for pointcut, advice etc.
. Extend Field and MethodInfo with isAjSynthetic()
. Extend jdt.internal.core.util.Dissassembler for aspectj

== Quick-fix support

This work package enables quick fix suggestions to be made for AspectJ elements.

. Extend ICorrectionRequestor interface
. Update implementors (in UI)

== Code formatting

This work package ensures that formatting AspectJ source doesn't mess up
pointcut declarations etc.

. Update implementation of DefaultCodeFormatter for AspectJ
. Extend CodeFormatterVisitor

== Searching

This work package enables searching for AspectJ elements in the search dialog and APIs.

. Expand IJavaSearch constants for Aj
. Expand SearchPattern for Aj
. Changes to search algorithm required??
. Extend ReferenceInfoAdapter
. Extend IIndexSearchRequestor with aj types
. Extend IndexSearchAdapter with aj types
. Extend AbstractIndexer with aj types
. Extend BinaryIndexer with aj types
. Extend IIndexConstants
. Extend SourceIndexRequestor (see also 4.3)
. Add xxxLocator and Pattern classes for aj elements?

== Sorting

This work package enables the correct sorting of AspectJ program elements
when an outline view is set to 'sorted' mode rather than showing elements in
their declared order  (I think!).

. Extend SortElementBuilder
. Extend SortJavaElement

== Cross-references

This work package enables the cross-reference view and visualiser to
correctly display the cross-cutting structure of an aspectj program.

. Create cross-reference map on batch build (1 map for whole workspace)
. Maintain cross-reference map on incremental build
. Add interfaces to retrieve cross-references for AspectJ elements
. Implement IXReferenceProvider

== Name lookups

I'm not sure what user interface features need this...

. Extend IJavaElementRequestor
. Extend SelectionRequestor, SingleTypeRequestor
. Investigate other implementors

== Version upgrade

. port to Eclipse 3.0 M9
. port to Eclipse 3.0 final

==  JDT Debug

. Extend jdt.internal.debug.core.hcr.JavaParseTreeBuilder ?
