Fixed case for intention actions texts.
This commit is contained in:
@@ -32,12 +32,12 @@ new.kotlin.file.action=Kotlin File
|
|||||||
import.fix=Import
|
import.fix=Import
|
||||||
imports.chooser.title=Imports
|
imports.chooser.title=Imports
|
||||||
specify.type.explicitly.action.family.name=Specify Type Explicitly
|
specify.type.explicitly.action.family.name=Specify Type Explicitly
|
||||||
specify.type.explicitly.add.return.type.action.name=Specify Return Type Explicitly
|
specify.type.explicitly.add.return.type.action.name=Specify return type explicitly
|
||||||
specify.type.explicitly.add.action.name=Specify Type Explicitly
|
specify.type.explicitly.add.action.name=Specify type explicitly
|
||||||
specify.type.explicitly.remove.action.name=Remove Explicitly Specified Type
|
specify.type.explicitly.remove.action.name=Remove explicitly specified type
|
||||||
|
|
||||||
add.kotlin.signature.action.family.name=Specify Custom Kotlin Signature
|
add.kotlin.signature.action.family.name=Specify Custom Kotlin Signature
|
||||||
add.kotlin.signature.action.text=Specify Custom Kotlin Signature
|
add.kotlin.signature.action.text=Specify custom Kotlin signature
|
||||||
|
|
||||||
goto.super.function.chooser.title=Choose super function
|
goto.super.function.chooser.title=Choose super function
|
||||||
goto.super.property.chooser.title=Choose super property
|
goto.super.property.chooser.title=Choose super property
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ package org.jetbrains.jet.plugin.quickfix;
|
|||||||
|
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.openapi.util.text.StringUtil;
|
|
||||||
import com.intellij.psi.PsiElement;
|
import com.intellij.psi.PsiElement;
|
||||||
import com.intellij.psi.util.PsiTreeUtil;
|
import com.intellij.psi.util.PsiTreeUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -40,10 +39,10 @@ public class SpecifyTypeExplicitlyFix extends SpecifyTypeExplicitlyAction {
|
|||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
JetNamedDeclaration declaration = PsiTreeUtil.getParentOfType(element, JetProperty.class, JetNamedFunction.class);
|
JetNamedDeclaration declaration = PsiTreeUtil.getParentOfType(element, JetProperty.class, JetNamedFunction.class);
|
||||||
if (declaration instanceof JetProperty) {
|
if (declaration instanceof JetProperty) {
|
||||||
setText(getQuickFixText(JetBundle.message("specify.type.explicitly.add.action.name")));
|
setText(JetBundle.message("specify.type.explicitly.add.action.name"));
|
||||||
}
|
}
|
||||||
else if (declaration instanceof JetNamedFunction) {
|
else if (declaration instanceof JetNamedFunction) {
|
||||||
setText(getQuickFixText(JetBundle.message("specify.type.explicitly.add.return.type.action.name")));
|
setText(JetBundle.message("specify.type.explicitly.add.return.type.action.name"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert false : "Couldn't find property or function";
|
assert false : "Couldn't find property or function";
|
||||||
@@ -51,10 +50,4 @@ public class SpecifyTypeExplicitlyFix extends SpecifyTypeExplicitlyAction {
|
|||||||
|
|
||||||
return !ErrorUtils.isErrorType(getTypeForDeclaration(declaration));
|
return !ErrorUtils.isErrorType(getTypeForDeclaration(declaration));
|
||||||
}
|
}
|
||||||
|
|
||||||
// There is an implicit rule that quick fix text has only first letter capitalized, while intention text
|
|
||||||
@NotNull
|
|
||||||
private static String getQuickFixText(@NotNull String intentionText) {
|
|
||||||
return StringUtil.capitalize(intentionText.toLowerCase());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// "Specify Type Explicitly" "false"
|
// "Specify type explicitly" "false"
|
||||||
val x = "<caret>"
|
val x = "<caret>"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// "Specify Type Explicitly" "true"
|
// "Specify type explicitly" "true"
|
||||||
fun getEntry() : Map.Entry<jet.Array<String>, java.sql.Array> {
|
fun getEntry() : Map.Entry<jet.Array<String>, java.sql.Array> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// "Specify Type Explicitly" "true"
|
// "Specify type explicitly" "true"
|
||||||
val x: (Int) -> String = { (a: Int) -> ""}
|
val x: (Int) -> String = { (a: Int) -> ""}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// "Specify Type Explicitly" "true"
|
// "Specify type explicitly" "true"
|
||||||
import java.util.HashMap
|
import java.util.HashMap
|
||||||
|
|
||||||
fun foo(map : HashMap<String, Int>) {
|
fun foo(map : HashMap<String, Int>) {
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
// "Remove Explicitly Specified Type" "true"
|
// "Remove explicitly specified type" "true"
|
||||||
|
|
||||||
val x = null
|
val x = null
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// "Specify Type Explicitly" "true"
|
// "Specify type explicitly" "true"
|
||||||
class String {}
|
class String {}
|
||||||
|
|
||||||
val x: jet.String = ""
|
val x: jet.String = ""
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
// "Remove Explicitly Specified Type" "true"
|
// "Remove explicitly specified type" "true"
|
||||||
val x = ""
|
val x = ""
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
// "Specify Type Explicitly" "true"
|
// "Specify type explicitly" "true"
|
||||||
val x: Unit = Unit.VALUE
|
val x: Unit = Unit.VALUE
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
// "Specify Type Explicitly" "false"
|
// "Specify type explicitly" "false"
|
||||||
val <caret>x = BadType()
|
val <caret>x = BadType()
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
// "Specify Type Explicitly" "false"
|
// "Specify type explicitly" "false"
|
||||||
val x = "<caret>"
|
val x = "<caret>"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// "Specify Type Explicitly" "true"
|
// "Specify type explicitly" "true"
|
||||||
fun getEntry() : Map.Entry<jet.Array<String>, java.sql.Array> {
|
fun getEntry() : Map.Entry<jet.Array<String>, java.sql.Array> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// "Specify Type Explicitly" "true"
|
// "Specify type explicitly" "true"
|
||||||
val x<caret> = { (a: Int) -> ""}
|
val x<caret> = { (a: Int) -> ""}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// "Specify Type Explicitly" "true"
|
// "Specify type explicitly" "true"
|
||||||
import java.util.HashMap
|
import java.util.HashMap
|
||||||
|
|
||||||
fun foo(map : HashMap<String, Int>) {
|
fun foo(map : HashMap<String, Int>) {
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
// "Remove Explicitly Specified Type" "true"
|
// "Remove explicitly specified type" "true"
|
||||||
|
|
||||||
val x : Map.Entry<Stri<caret>ng, Int>? = null
|
val x : Map.Entry<Stri<caret>ng, Int>? = null
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// "Specify Type Explicitly" "true"
|
// "Specify type explicitly" "true"
|
||||||
class String {}
|
class String {}
|
||||||
|
|
||||||
val <caret>x = ""
|
val <caret>x = ""
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
// "Remove Explicitly Specified Type" "true"
|
// "Remove explicitly specified type" "true"
|
||||||
val x<caret> : String = ""
|
val x<caret> : String = ""
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
// "Specify Type Explicitly" "true"
|
// "Specify type explicitly" "true"
|
||||||
val x <caret>= Unit.VALUE
|
val x <caret>= Unit.VALUE
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
// "Specify Type Explicitly" "false"
|
// "Specify type explicitly" "false"
|
||||||
val <caret>x = BadType()
|
val <caret>x = BadType()
|
||||||
Reference in New Issue
Block a user