Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9130

Add a dynamic parser to colorize and indent groovy textareas

    Details

    • Similar Issues:

      Description

      In Jenkins, the groovy scripts inserted may be complex.

      It would be interesting to color these scripts dynamically using the javascript library CodeMirror and groovy parser provided by eXo Platform SAS (if license permits)

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            @domi why so much work? All you need to do is to add

             codemirror-mode="clike" codemirror-config="'onBlur': cmChange"

            to <f:textarea/>.

            (When https://github.com/stapler/stapler-adjunct-codemirror/issues/1 is implemented the Groovy support will be better, but in the meantime this is the standard way of making a Groovy textarea.)

            Show
            jglick Jesse Glick added a comment - @domi why so much work? All you need to do is to add codemirror-mode= "clike" codemirror-config= " 'onBlur' : cmChange" to <f:textarea/> . (When https://github.com/stapler/stapler-adjunct-codemirror/issues/1 is implemented the Groovy support will be better, but in the meantime this is the standard way of making a Groovy textarea.)
            Hide
            sschuberth Sebastian Schuberth added a comment - - edited

            Hmm, so what's the status of this? I recently saw that the Scriptler plugin has nice syntax highlighting and line numbers, and I was about to propose the same for the Groovy and Groovy Postbuild plugins. Because at least the Groovy plugin versions we're using do not yet seem to have this feature enabled, although my understanding is that ever since the commit at [1] from 2011 the Jenkins core offers syntax highlighted textboxes.

            EDIT: Correction, I just verifier that the Groovy plugin version 1.20 indeed has syntax highlighting, but the Groovy Postbuild plugin version 1.10 still has not.

            [1] https://github.com/jenkinsci/jenkins/commit/19b81cfb2a61b4b02e07450152d6781455443b87

            Show
            sschuberth Sebastian Schuberth added a comment - - edited Hmm, so what's the status of this? I recently saw that the Scriptler plugin has nice syntax highlighting and line numbers, and I was about to propose the same for the Groovy and Groovy Postbuild plugins. Because at least the Groovy plugin versions we're using do not yet seem to have this feature enabled, although my understanding is that ever since the commit at [1] from 2011 the Jenkins core offers syntax highlighted textboxes. EDIT: Correction, I just verifier that the Groovy plugin version 1.20 indeed has syntax highlighting, but the Groovy Postbuild plugin version 1.10 still has not. [1] https://github.com/jenkinsci/jenkins/commit/19b81cfb2a61b4b02e07450152d6781455443b87
            Hide
            jglick Jesse Glick added a comment -

            Adding CodeMirror support to a plugin is easy. Unfortunately its implementation in core is currently broken in several respects.

            Show
            jglick Jesse Glick added a comment - Adding CodeMirror support to a plugin is easy. Unfortunately its implementation in core is currently broken in several respects.
            Hide
            vjuranek vjuranek added a comment -

            Closing as syntax highlighting is already present in groovy plugin (actually for pretty long time, since rel. 1.15)

            Show
            vjuranek vjuranek added a comment - Closing as syntax highlighting is already present in groovy plugin (actually for pretty long time, since rel. 1.15)
            Hide
            yusuf_gunaydin Yusuf Tarık Günaydın added a comment -

            Sorry for reviving an old issue, but System Groovy script doesn't have syntax coloring in build steps.

            Show
            yusuf_gunaydin Yusuf Tarık Günaydın added a comment - Sorry for reviving an old issue, but System Groovy script doesn't have syntax coloring in build steps.

              People

              • Assignee:
                vjuranek vjuranek
                Reporter:
                ptitrene Dominique Arnou
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: