Open CodeDrivenMitch opened 1 month ago
The popup contains the place the query is published
The popup is not there. It seems the IDEA SDK does not detect a zero-arg constructor as an actual constructor, as this test fails:
fun `test resolves zero-arg constructor as creator too in java`() { addFile("MyZeroArgQuery.java", """ public class MyZeroArgQuery { } """.trimIndent()) addFile( "MyQueryPublisher.java", """ import test.MyZeroArgQuery; class MyQueryPublisher { private final QueryGateway queryGateway; public MyQueryPublisher(QueryGateway queryGateway) { this.queryGateway = queryGateway; } public void publish() { queryGateway.query(new MyZeroArgQuery(), String.class); } } """.trimIndent(), open = true ) val creators = project.creatorResolver().getCreatorsForPayload("test.MyZeroArgQuery") Assertions.assertThat(creators).anyMatch { it.payload == "test.MyZeroArgQuery" && it.renderText() == "MyQueryPublisher.publish" it.renderContainerText() == null } }
I have been unable to resolve this issue, as neither the Psi nor UAST sees the constructor for Java. For Kotlin it works. Posted a question to Jetbrains for clarification.
Basic information
Steps to reproduce
Expected behaviour
The popup contains the place the query is published
Actual behaviour
The popup is not there. It seems the IDEA SDK does not detect a zero-arg constructor as an actual constructor, as this test fails: