Enabling certain java refactoring within Groovy editor in IntelliJ
From within IntelliJ IDEA, when I'm within a groovy class, and refer to a property / field on java class that doesn't exist, is there a way to enable the create property refactoring?
Eg:
开发者_如何学Go// Inside Foo.groovy
void method()
{
Bar bar = new Bar(); // Defined in Bar.java
bar.someProperty = "Hello, world"; // bar.someProperty doesn't exist.
}
In the above example, I'd like to get access to the "create property" refactoring option on someProperty. Is there a way to enable this?
Note: I'm using IntelliJ 10.
As of now, refactorings for Groovy in IntelliJ are pretty limited compared to Java. The reason for this is Groovy is an optionally typed language, so the IDE needs much more 'brain' for Groovy refactorings than for Java.
create property
currently does not exist for Groovy.
IMHO the only thing you can do is filing a ticket on http://youtrack.jetbrains.net. Jetbrains is very responsive - I know from own experience.
精彩评论