From 0278a6c8a4a0a355d2c79ce2d77900f60f57b5dc Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 26 Jul 2016 18:46:53 +0300 Subject: [PATCH] Make constructor parameter a property: message shortened a bit (cherry picked from commit 1938909) --- .../idea/quickfix/MakeConstructorParameterPropertyFix.kt | 6 ++++-- .../quickfix/makeConstructorParameterProperty/inner.kt | 2 +- .../makeConstructorParameterProperty/inner.kt.after | 2 +- .../quickfix/makeConstructorParameterProperty/val.kt | 2 +- .../quickfix/makeConstructorParameterProperty/val.kt.after | 2 +- .../quickfix/makeConstructorParameterProperty/var.kt | 2 +- .../quickfix/makeConstructorParameterProperty/var.kt.after | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/MakeConstructorParameterPropertyFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/MakeConstructorParameterPropertyFix.kt index 4d1f1ea47e3..af1b409fb11 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/MakeConstructorParameterPropertyFix.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/MakeConstructorParameterPropertyFix.kt @@ -35,10 +35,12 @@ import org.jetbrains.kotlin.psi.psiUtil.nonStaticOuterClasses class MakeConstructorParameterPropertyFix( element: KtParameter, private val kotlinValVar: KotlinValVar, className: String? ) : KotlinQuickFixAction(element) { - override fun getFamilyName() = "Make primary constructor parameter a property" + override fun getFamilyName() = "Make constructor parameter a property" private val suffix = if (className != null) " in class '$className'" else "" - override fun getText() = "Make primary constructor parameter '${element.name}' a property" + suffix + + override fun getText() = + "Make constructor parameter a property$suffix" override fun isAvailable(project: Project, editor: Editor?, file: PsiFile): Boolean { return super.isAvailable(project, editor, file) && !element.hasValOrVar() diff --git a/idea/testData/quickfix/makeConstructorParameterProperty/inner.kt b/idea/testData/quickfix/makeConstructorParameterProperty/inner.kt index d217ac834e3..e67d183cc2f 100644 --- a/idea/testData/quickfix/makeConstructorParameterProperty/inner.kt +++ b/idea/testData/quickfix/makeConstructorParameterProperty/inner.kt @@ -1,4 +1,4 @@ -// "Make primary constructor parameter 'bar' a property in class 'B'" "true" +// "Make constructor parameter a property in class 'B'" "true" class B(bar: String) { diff --git a/idea/testData/quickfix/makeConstructorParameterProperty/inner.kt.after b/idea/testData/quickfix/makeConstructorParameterProperty/inner.kt.after index 3ec5c7d39eb..9b82e6bdf9d 100644 --- a/idea/testData/quickfix/makeConstructorParameterProperty/inner.kt.after +++ b/idea/testData/quickfix/makeConstructorParameterProperty/inner.kt.after @@ -1,4 +1,4 @@ -// "Make primary constructor parameter 'bar' a property in class 'B'" "true" +// "Make constructor parameter a property in class 'B'" "true" class B(private val bar: String) { diff --git a/idea/testData/quickfix/makeConstructorParameterProperty/val.kt b/idea/testData/quickfix/makeConstructorParameterProperty/val.kt index 62049c7ed2d..330a78945e8 100644 --- a/idea/testData/quickfix/makeConstructorParameterProperty/val.kt +++ b/idea/testData/quickfix/makeConstructorParameterProperty/val.kt @@ -1,4 +1,4 @@ -// "Make primary constructor parameter 'foo' a property" "true" +// "Make constructor parameter a property" "true" class A(foo: String) { fun bar() { diff --git a/idea/testData/quickfix/makeConstructorParameterProperty/val.kt.after b/idea/testData/quickfix/makeConstructorParameterProperty/val.kt.after index 5fdd9071d09..84cdbe58369 100644 --- a/idea/testData/quickfix/makeConstructorParameterProperty/val.kt.after +++ b/idea/testData/quickfix/makeConstructorParameterProperty/val.kt.after @@ -1,4 +1,4 @@ -// "Make primary constructor parameter 'foo' a property" "true" +// "Make constructor parameter a property" "true" class A(private val foo: String) { fun bar() { diff --git a/idea/testData/quickfix/makeConstructorParameterProperty/var.kt b/idea/testData/quickfix/makeConstructorParameterProperty/var.kt index e7e855b1837..9df5032e97f 100644 --- a/idea/testData/quickfix/makeConstructorParameterProperty/var.kt +++ b/idea/testData/quickfix/makeConstructorParameterProperty/var.kt @@ -1,4 +1,4 @@ -// "Make primary constructor parameter 'foo' a property" "true" +// "Make constructor parameter a property" "true" class A(foo: String) { fun bar() { diff --git a/idea/testData/quickfix/makeConstructorParameterProperty/var.kt.after b/idea/testData/quickfix/makeConstructorParameterProperty/var.kt.after index c1781aa27cf..708ab4fe53d 100644 --- a/idea/testData/quickfix/makeConstructorParameterProperty/var.kt.after +++ b/idea/testData/quickfix/makeConstructorParameterProperty/var.kt.after @@ -1,4 +1,4 @@ -// "Make primary constructor parameter 'foo' a property" "true" +// "Make constructor parameter a property" "true" class A(private var foo: String) { fun bar() {