Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3432

Groovy Console needs option to show AST of current script

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 1.7-beta-1
    • Groovy Console
    • 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.

      Attachments

        1. AstBrowser1.0.patch
          38 kB
          Hamlet D'Arcy
        2. bullet_green.png
          0.3 kB
          Hamlet D'Arcy
        3. Image 1.png
          61 kB
          Guillaume Sauthier

        Activity

          People

            guillaume Guillaume Sauthier
            hamletdrc Hamlet D'Arcy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.6h
                0.6h
                Remaining:
                Remaining Estimate - 0.6h
                0.6h
                Logged:
                Time Spent - Not Specified
                Not Specified