mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] test transformations aren't run during annotation resolution
This commit is contained in:
+29
@@ -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() {}
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user