KotlinLanguageInjector: support for nested annotations (#KT-21753)
This commit is contained in:
@@ -519,6 +519,39 @@ class KotlinInjectionTest : AbstractInjectionTest() {
|
||||
""")
|
||||
}
|
||||
|
||||
fun testInjectionInJavaNestedAnnotation() {
|
||||
myFixture.addClass(
|
||||
"""
|
||||
package myinjection;
|
||||
|
||||
public @interface InHtml {
|
||||
String html();
|
||||
}
|
||||
"""
|
||||
)
|
||||
myFixture.addClass(
|
||||
"""
|
||||
package myinjection;
|
||||
|
||||
public @interface InHtmls {
|
||||
InHtml[] htmls();
|
||||
}
|
||||
"""
|
||||
)
|
||||
doAnnotationInjectionTest(
|
||||
injectedLanguage = HTMLLanguage.INSTANCE.id,
|
||||
pattern = """psiMethod().withName("html").withParameters().definedInClass("myinjection.InHtml")""",
|
||||
kotlinCode = """
|
||||
import myinjection.InHtml
|
||||
import myinjection.InHtmls
|
||||
|
||||
@InHtmls(htmls = [InHtml(html = "<htm<caret>l></html>")])
|
||||
fun foo() {
|
||||
}
|
||||
"""
|
||||
)
|
||||
}
|
||||
|
||||
fun testInjectionInAliasedJavaAnnotation() {
|
||||
myFixture.addClass("""
|
||||
@interface InHtml {
|
||||
|
||||
Reference in New Issue
Block a user