Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8-rc-2
-
Fix Version/s: 1.8.6, 2.0-beta-3
-
Component/s: Compiler
-
Labels:None
-
Number of attachments :
Description
Groovy-Eclipse runs a patched form of groovyc. I want to start moving those patches back into groovyc itself, with the medium term goal of running an unpatched groovyc. Initially I'm collected together a few small things here, just to see if we have a process that can work for us. This patch was created on 1.8.0 rc2 and as far as I can tell still passes all the groovy tests (I simply ran 'ant install' to check). What does it contain:
GrabAnnotationTransformation. A null check. Under groovy-eclipse we operate a recoverable compiler so that we don't totally give up on the first problem encountered. This means sometimes code now runs that has to make an attempt to cope with errors having happened earlier on. Usually this is just a 'check if null, don't do this operation' type thing. This null check is one such case of that.
VariableScope. Extra helper method for accessing an iterator over the declared variables.
CompilationUnit/GroovyClass. When eclipse is processing 'GroovyClass' objects, it is very helpful to know where they came from. The patches here cause GroovyClass to know its originating classNode and SourceUnit.
ResolveVisitor. Under eclipse we have a subclass of resolve visitor that resolves types using JDT information. To do its work it needs to override some methods - this patch changes some methods from private to protected.
.classpath The .classpath currently in 1.8.0rc2 is out of date, some dependencies are missing and some haven't been added. This fixes those.
In addition it would be nice to get GROOVY-4553 fixed - is it definetly going to be in 1.8-rc-4? (that is the current target)
I'm not saying these changes need to be in 1.8.0, because you are in RC phase, but sometime in the early 1.8 streams would be nice. I tried to pick non-controversial changes initially - the tricky stuff is still to come. As of the 1.8.0 patch job I just did we currently modify around 50 groovy files, every little we can do to reduce that will help.
I wonder if you planed to attache the patch here Andy. Without it it is a bit diffcult to tell about good or bad.
So it is for example unclear to me as of why GrabAnnotationTransformation needs an additional null and how that is connected to error recovery. In the best case the error recovery would still produce an AST that all phasses that are supposed to run with can still do so.
As for VariableScope. I guess such an iterator is good, for the other cases with have that already. What is needed though is an API test to ensure we won't do bad things here later.
As for .classpath.... how does that affect the groovy plugin? Sure, it is a good thing to fix that for other developers (I don't use it at all), but how is it related to the plugin?
As for ResolveVisitor... I really wonder if we should built in some abstraction instead of subclassing.... I mean sublcassing alone won't do it for you or not? You also have to "replace" the visitor.