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

Add a dynamic parser to colorize and indent groovy textareas

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • groovy-plugin
    • None

      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)

          [JENKINS-9130] Add a dynamic parser to colorize and indent groovy textareas

          Code changed in jenkins
          User: imod
          Path:
          .gitignore
          pom.xml
          src/main/java/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment.java
          src/main/java/org/jvnet/hudson/plugins/scriptler/ScritplerPluginImpl.java
          src/main/java/org/jvnet/hudson/plugins/scriptler/config/ScriptlerConfiguration.java
          src/main/java/org/jvnet/hudson/plugins/scriptler/util/ScriptHelper.java
          src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/edit.jelly
          src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/runscript.jelly
          src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/scriptsettings.jelly
          src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/settings.jelly
          src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/settings.properties
          src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/sidepanel.jelly
          src/main/webapp/lib/codemirror.css
          src/main/webapp/lib/codemirror.js
          src/main/webapp/lib/overlay.js
          src/main/webapp/mode/clike/clike.css
          src/main/webapp/mode/clike/clike.js
          src/main/webapp/mode/clike/index.html
          http://jenkins-ci.org/commit/scriptler-plugin/bc3f719cfa5e6f6831259dfe68e4141ca1b205f8
          Log:
          JENKINS-9302, JENKINS-9130 colorize groovy script areas

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: .gitignore pom.xml src/main/java/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment.java src/main/java/org/jvnet/hudson/plugins/scriptler/ScritplerPluginImpl.java src/main/java/org/jvnet/hudson/plugins/scriptler/config/ScriptlerConfiguration.java src/main/java/org/jvnet/hudson/plugins/scriptler/util/ScriptHelper.java src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/edit.jelly src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/runscript.jelly src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/scriptsettings.jelly src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/settings.jelly src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/settings.properties src/main/resources/org/jvnet/hudson/plugins/scriptler/ScriptlerManagment/sidepanel.jelly src/main/webapp/lib/codemirror.css src/main/webapp/lib/codemirror.js src/main/webapp/lib/overlay.js src/main/webapp/mode/clike/clike.css src/main/webapp/mode/clike/clike.js src/main/webapp/mode/clike/index.html http://jenkins-ci.org/commit/scriptler-plugin/bc3f719cfa5e6f6831259dfe68e4141ca1b205f8 Log: JENKINS-9302 , JENKINS-9130 colorize groovy script areas

          I'm close to fnish this for scriptler and will implement it for the other plugins too.
          As soon as I'm done, I'll send a pull request to the other plugin maintainers...

          Dominik Bartholdi added a comment - I'm close to fnish this for scriptler and will implement it for the other plugins too. As soon as I'm done, I'll send a pull request to the other plugin maintainers...

          I just send a pull request for the groovy-postbuild-plugin:
          https://github.com/jenkinsci/groovy-postbuild-plugin/pull/1

          Dominik Bartholdi added a comment - I just send a pull request for the groovy-postbuild-plugin: https://github.com/jenkinsci/groovy-postbuild-plugin/pull/1

          as this s implemented for scriptler and groovy-postbuild I'll remove these from the components list...

          ...but there is still the groovy plugin to be done

          Dominik Bartholdi added a comment - as this s implemented for scriptler and groovy-postbuild I'll remove these from the components list... ...but there is still the groovy plugin to be done

          assign it to vjuranek for the groovy plugin

          Dominik Bartholdi added a comment - assign it to vjuranek for the groovy plugin

          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.)

          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.)

          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

          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

          Jesse Glick added a comment -

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

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

          vjuranek added a comment -

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

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

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

          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.

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

              Created:
              Updated:
              Resolved: