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

Use ACE editor annotations to show Groovy syntax errors

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline

      A regular stapler validation message is currently shown for Groovy syntax validation messages.
      Since this validation messages are linked to source lines, it could take advantage of ACE editor annotation API to show this messages behind the affected line.

      editor.getSession().setAnnotations([{
        row: 1,
        column: 10,
        text: "Error message"
        type: "error" // also warning and information if needed
      }]);
      

      row, column and text can be retrieved from the current error message, but for better design CpsFlowDefinition.DescriptorImpl.doCheckScript should be modified to return a JSON containing this data.

          [JENKINS-32067] Use ACE editor annotations to show Groovy syntax errors

          Antonio Muñiz created issue -

          This is a replacement of the message shown in JENKINS-31909

          Antonio Muñiz added a comment - This is a replacement of the message shown in JENKINS-31909
          Antonio Muñiz made changes -
          Link New: This issue is related to JENKINS-31909 [ JENKINS-31909 ]
          Antonio Muñiz made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-31909 [ JENKINS-31909 ]
          Jesse Glick made changes -
          Link Original: This issue is related to JENKINS-31909 [ JENKINS-31909 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-31909 [ JENKINS-31909 ]
          Jesse Glick made changes -
          Link Original: This issue depends on JENKINS-31909 [ JENKINS-31909 ]
          Antonio Muñiz made changes -
          Remote Link New: This issue links to "PR 281 (Web Link)" [ 13740 ]

          Code changed in jenkins
          User: Antonio Muñiz
          Path:
          cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition.java
          cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinitionValidator.java
          cps/src/main/js/workflow-editor.js
          http://jenkins-ci.org/commit/workflow-plugin/31e5a8f86cd9f8a5d28d422b4a07d5f946990ce9
          Log:
          JENKINS-32067 Show groovy syntax errors as ACE editor annotations

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Antonio Muñiz Path: cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition.java cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinitionValidator.java cps/src/main/js/workflow-editor.js http://jenkins-ci.org/commit/workflow-plugin/31e5a8f86cd9f8a5d28d422b4a07d5f946990ce9 Log: JENKINS-32067 Show groovy syntax errors as ACE editor annotations

            amuniz Antonio Muñiz
            amuniz Antonio Muñiz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: