GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-1354

Groovy formatter ignoring @formatter:off directive

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.6.1.M1
    • Fix Version/s: None
    • Component/s: Formatting
    • Labels:
    • Environment:
      STS 2.8.1
    • Number of attachments :
      0

      Description

      I have lists that are being broken onto separate lines that I wish to keep on the same line.

      I tried to simply turn off formatting for this section of code, to no avail.

      It appears that the groovy formatter does not respond to this directive: @formatter:off that is part of the base eclipse formatter

      grails.plugins.springsecurity.interceptUrlMap = [
      '/js/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
      '/css/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
      '/images/**': ['IS_AUTHENTICATED_ANONYMOUSLY']]

      is being turned into

      grails.plugins.springsecurity.interceptUrlMap = [
      '/js/**': [
      'IS_AUTHENTICATED_ANONYMOUSLY'
      ],
      '/css/**': [
      'IS_AUTHENTICATED_ANONYMOUSLY'
      ],
      '/images/**': [
      'IS_AUTHENTICATED_ANONYMOUSLY'
      ]

        Activity

        Hide
        Andrew Eisenberg added a comment -

        Yes, this is not something we have implemented yet. It would be a good thing to have.

        Show
        Andrew Eisenberg added a comment - Yes, this is not something we have implemented yet. It would be a good thing to have.
        Hide
        Hidetoshi Ayabe added a comment -

        Hi.I tried to write this feature.
        It may be ignored by adding a simple code to GroovyBeautifier class.

        exsample:
        https://github.com/aya-eiya/groovy-eclipse/commit/bff36f3ed58f84cb576c989a5097421e2c1cc7ee

        The plugin has some formatting features,and this code cannot ignore the lines all cases.
        But,In most cases, it should be all right.

        Show
        Hidetoshi Ayabe added a comment - Hi.I tried to write this feature. It may be ignored by adding a simple code to GroovyBeautifier class. exsample: https://github.com/aya-eiya/groovy-eclipse/commit/bff36f3ed58f84cb576c989a5097421e2c1cc7ee The plugin has some formatting features,and this code cannot ignore the lines all cases. But,In most cases, it should be all right.

          People

          • Assignee:
            Unassigned
            Reporter:
            Peter Larson
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: