Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
When the compiler reports an error through an exception the code in GroovyProject doesn't get the AST built during the initial phases.
Here is the patch for the class GroovyProject that allows to get the AST built even if an exception occured.
I also added a catch for some hard error for which we should inform the user through a marker on the project.
private void compileGroovyFiles(final ChangeSet changeSet, final boolean generateClassFiles) {
CompilationUnit compilationUnit = createCompilationUnit("");
compilationUnit.addSources(changeSet.fileNamesToBuild());
try
catch (CompilationFailedException e)
{ handleCompilationError(changeSet.getFilesToBuild(), e); }catch(NoClassDefFoundError e)
{ GroovyPlugin.log(e); // TODO should add marker in project or similar } // update project info that maps source files to compiled class info
CompileUnit compileUnit = compilationUnit.getAST();
updateClassNameModuleNodeMap(compileUnit.getModules());
}