Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 2.5.1Release
-
Fix Version/s: 2.7.0.Release
-
Component/s: Compiler Integration
-
Labels:None
-
Number of attachments :
Description
Currently, AST transforms are disabled when run as part of a reconcile operation. However, this means that some valid code will be seen as errors when viewed in the editor (even thought the groovy script/application will run correctly when launched).
There should be a way of determining that certain AST transforms are "safe" to run in the editor. "Safe" transforms are ones that only require local state and are purely additive. Things like @Delegate and @Singleton would be safe, byt things like @Lazy would not (since code blocks get moved around).
Issue Links
- is depended upon by
-
GRECLIPSE-1171
@Field not supported in editor
-
- is superceded by
-
GRECLIPSE-1406
selectively allow some ast transforms to run during reconciling
-
The most promising way that I can see this happening is through the use of a meta-annotation. An AST transform class (or the annotation associated with it will have this annotation on it and this would mean that the transform creator takes all responsibility for safety.
The biggest problem here is that determining if a transform has this annotation is expensive if it is done on every reconcile. If we keep track of this through caching, then it is problematic to keep the cache up to date as source code changes.