[groovy] test transformations aren't run during annotation resolution

This commit is contained in:
Daniil Ovchinnikov
2017-09-20 14:28:08 +02:00
parent 91b0c745f8
commit 2da62ed2f6
@@ -17,10 +17,13 @@ package org.jetbrains.plugins.groovy.transformations
import com.intellij.testFramework.LightProjectDescriptor
import groovy.transform.CompileStatic
import org.jetbrains.annotations.NotNull
import org.jetbrains.plugins.groovy.GroovyLightProjectDescriptor
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrAccessorMethod
import org.jetbrains.plugins.groovy.lang.resolve.GroovyResolveTestCase
import static com.intellij.testFramework.PlatformTestUtil.registerExtension
@CompileStatic
class GrTransformationsTest extends GroovyResolveTestCase {
@@ -53,4 +56,30 @@ class A {
''')
myFixture.checkHighlighting()
}
void 'test dont transform classes while resolving annotation'() {
fixture.addFileToProject 'foo/bar/classes.groovy', '''\
package foo.bar
class Hello {}
class World {}
'''
registerExtension AstTransformationSupport.EP_NAME, new AstTransformationSupport() {
@Override
void applyTransformation(@NotNull TransformationContext context) {
assert false: "Transformations are not allowed for $context.codeClass.name"
}
}, testRootDisposable
resolveByText '''\
import static foo.bar.Hello.Foo
@Fo<caret>o
def foo() {}
'''
resolveByText '''\
import static foo.bar.World.*
@Fo<caret>o
def foo() {}
'''
}
}