Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7.0
-
None
-
Tested in WinXP Java 1.6
-
Patch
Description
The Groovy 1.7 roadmap contains an AST Viewer built into Groovy Console. This ticket has that attached. It is discussed in more detail in the mailing list here:
http://www.nabble.com/AST-Viewer-in-GroovyConsole-td22557763.html
The AST Viewer is a new menu option directly underneath "Inspect Last Variable" menu option. It opens a new non-modal dialog that shows a tree+table format of the AST generated by the current script. There is a dropdown list to pick the compile phase and a refresh button to refresh from the script window. Each node displayed can be customized in $home/.groovy/AstBrowserProperties.groovy . Screen location and size preferences are stored and restored between invocations. THere is a single unit test. Please be sure to run this test again after applying the patch! Also, there was a change to the Mac OS menus that I was unable to test b/c I don't have access to one. This tree node icon was taken from the silk icons already in use in GroovyConsole, so it is creative commons and free to us.
The code is broken between 2 files: the view layer is in AstBrowser.groovy and the compile work is in ScriptToTreeNodeAdapter.groovy
I updated the build.xml file to not compile AstBrowserProperties.groovy and treat it as a resource.
Let me know if there is anything else I can do.