Uploaded image for project: 'Spring Tool Suite'
  1. Spring Tool Suite
  2. STS-3946

'static mapping' code block breaks syntax highlighting and content assist

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.5.1.RELEASE
    • Fix Version/s: None
    • Component/s: EDITING, GRAILS
    • Labels:
      None
    • Environment:
      Windows 7 x64

      Description

      When you add a 'static mapping' code block to a grails domain class, the content assist and syntax highlighting does not work anymore for this domain class. This does not only affect the .groovy domain class file but also the rest of the workspace.

      Steps to reproduce:

      • create a new project with two domain classes `Test1` and `Test2` being in the same package.
      • Add the following code:

      package org.test

      class Test1 {
      Test2 someOtherObject
      String someProperty

      static constraints = {
      }
      def doSomethingWithSomeProperty()

      { someOtherObject.someMethod.replaceAll(/hello/, '$1 friend') someProperty }

      }

      package org.test

      class Test2 {

      static constraints = {
      }
      String getSomeMethod()

      { return 'hello' }

      }

      Everything should work fine so far. In Test1 someProperty and someMethod are highlighted in blue, as they are both either a property or an implicitly called get method.

      Now, if you add an empty `static mapping` code block to `Test2`, the syntax highlighting of `someMethod` call in `Test1` will switch from blue to black-italic. Also, content assist does not work anymore; the replaceAll is underlined because `someMethod` is not actually recognized.

      This already restricts usability, but if you add another `static mapping` code block to `Test1`, the method of `Test` will not even be recognized anymore.

      I've set the priority to major because this is slowing down all working processes significantly, although it may seem trivial at the first glance. Typos happen more frequently if you do not have the content assist telling you about it. If this is not a major bug, just set it to minor.

        Activity

        Hide
        nst1nctz Felix Jian added a comment -

        I tried with grails 2.4.0, 2.4.1, 2.4.2, 2.4.3 and 1.3.7. The issue is only reproducible with grails 2.4.x.

        Show
        nst1nctz Felix Jian added a comment - I tried with grails 2.4.0, 2.4.1, 2.4.2, 2.4.3 and 1.3.7. The issue is only reproducible with grails 2.4.x.
        Hide
        aclement Andy Clement added a comment -

        Please try updating your greclipse to the latest snapshot from:

        http://dist.springsource.org/snapshot/GRECLIPSE/e4.4/

        we have put in a potential fix.

        Show
        aclement Andy Clement added a comment - Please try updating your greclipse to the latest snapshot from: http://dist.springsource.org/snapshot/GRECLIPSE/e4.4/ we have put in a potential fix.
        Hide
        mlippert Martin Lippert added a comment -

        We no longer work on the Grails integration for Eclipse, therefore I am closing all the remaining open issues here.
        The code of the project is still available as open-source at GitHub: https://github.com/spring-projects/grails-ide

        Show
        mlippert Martin Lippert added a comment - We no longer work on the Grails integration for Eclipse, therefore I am closing all the remaining open issues here. The code of the project is still available as open-source at GitHub: https://github.com/spring-projects/grails-ide

          People

          • Assignee:
            Unassigned
            Reporter:
            nst1nctz Felix Jian
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: