Better text for ChangeVariableTypeFix
This commit is contained in:
@@ -30,6 +30,7 @@ import org.jetbrains.jet.lang.psi.*;
|
|||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lang.types.JetType;
|
import org.jetbrains.jet.lang.types.JetType;
|
||||||
import org.jetbrains.jet.plugin.JetBundle;
|
import org.jetbrains.jet.plugin.JetBundle;
|
||||||
import org.jetbrains.jet.plugin.caches.resolve.KotlinCacheManagerUtil;
|
import org.jetbrains.jet.plugin.caches.resolve.KotlinCacheManagerUtil;
|
||||||
@@ -48,7 +49,11 @@ public class ChangeVariableTypeFix extends JetIntentionAction<JetVariableDeclara
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String getText() {
|
public String getText() {
|
||||||
return JetBundle.message("change.element.type", element.getName(), renderedType);
|
String propertyName = element.getName();
|
||||||
|
FqName fqName = JetPsiUtil.getFQName(element);
|
||||||
|
if (fqName != null) propertyName = fqName.asString();
|
||||||
|
|
||||||
|
return JetBundle.message("change.element.type", propertyName, renderedType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Change 'x' type to '(String) -> Int'" "true"
|
// "Change 'B.x' type to '(String) -> Int'" "true"
|
||||||
trait A {
|
trait A {
|
||||||
var x: (String) -> Int
|
var x: (String) -> Int
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Change 'x' type to 'Int'" "true"
|
// "Change 'A.x' type to 'Int'" "true"
|
||||||
trait X {
|
trait X {
|
||||||
val x: Int
|
val x: Int
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Change 'x' type to 'Int'" "true"
|
// "Change 'B.x' type to 'Int'" "true"
|
||||||
abstract class A {
|
abstract class A {
|
||||||
abstract var x : Int
|
abstract var x : Int
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Change 'x' type to 'Int'" "true"
|
// "Change 'B.x' type to 'Int'" "true"
|
||||||
abstract class A {
|
abstract class A {
|
||||||
abstract var x : Int
|
abstract var x : Int
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Change 'x' type to '(String) -> Int'" "true"
|
// "Change 'B.x' type to '(String) -> Int'" "true"
|
||||||
trait A {
|
trait A {
|
||||||
var x: (String) -> Int
|
var x: (String) -> Int
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Change 'x' type to 'Int'" "true"
|
// "Change 'A.x' type to 'Int'" "true"
|
||||||
trait X {
|
trait X {
|
||||||
val x: Int
|
val x: Int
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Change 'x' type to 'Int'" "true"
|
// "Change 'B.x' type to 'Int'" "true"
|
||||||
abstract class A {
|
abstract class A {
|
||||||
abstract var x : Int
|
abstract var x : Int
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Change 'x' type to 'Int'" "true"
|
// "Change 'B.x' type to 'Int'" "true"
|
||||||
abstract class A {
|
abstract class A {
|
||||||
abstract var x : Int
|
abstract var x : Int
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user