groovy-guru icon indicating copy to clipboard operation
groovy-guru copied to clipboard

Go to definition for @Fields and def fails

Open stevenh opened this issue 1 year ago • 2 comments

When selecting Go to Definition on a @Field definition for a Jenkinsfile it fails with:

Cannot read properties of undefined (reading 'with')

This should be a minimal example, if you select MYFIELD use.

import groovy.transform.Field

@Field final MYFIELD = 'SomeValue'

def variable = 'otherValue'

if (variable == MYFIELD) {
    echo 'Value matches.'
}

stevenh avatar Aug 07 '23 23:08 stevenh

In case it helps, Find References works as expected, including finding the definition.

stevenh avatar Aug 08 '23 08:08 stevenh

Also fails with def definition too, so in the case above select variable and Go to Definition fails with the same error.

stevenh avatar Aug 08 '23 08:08 stevenh