replace 'trait' keyword with 'interface' in user-visible messages and code generation tools
This commit is contained in:
@@ -136,7 +136,7 @@ livetemplate.description.void=Function returning nothing
|
||||
livetemplate.description.fun0=Function with no parameters
|
||||
livetemplate.description.fun1=Function with one parameter
|
||||
livetemplate.description.fun2=Function with two parameters
|
||||
livetemplate.description.interface=Trait
|
||||
livetemplate.description.interface=Interface
|
||||
livetemplate.description.singleton=Singleton
|
||||
livetemplate.description.closure=Closure (function without name)
|
||||
livetemplate.description.anonymous=Anonymous class
|
||||
@@ -158,7 +158,6 @@ options.kotlin.attribute.descriptor.arrow=Arrow
|
||||
options.kotlin.attribute.descriptor.kdoc.comment=KDoc comment
|
||||
options.kotlin.attribute.descriptor.kdoc.tag=KDoc tag
|
||||
options.kotlin.attribute.descriptor.kdoc.value=Link in KDoc tag
|
||||
options.kotlin.attribute.descriptor.trait=Trait
|
||||
options.kotlin.attribute.descriptor.object=Object
|
||||
options.kotlin.attribute.descriptor.annotation=Annotation
|
||||
options.kotlin.attribute.descriptor.var=Var (mutable variable, parameter or property)
|
||||
@@ -209,7 +208,6 @@ create.from.usage.family=Create from usage
|
||||
create.0.from.usage=Create {0}
|
||||
create.local.variable.from.usage=Create local variable ''{0}''
|
||||
create.parameter.from.usage=Create parameter ''{0}''
|
||||
choose.target.class.or.trait.title=Choose target class or trait
|
||||
surround.with=Surround with
|
||||
surround.with.string.template="${expr}"
|
||||
surround.with.when.template=when (expr) {}
|
||||
@@ -368,7 +366,7 @@ usageType.packageMemberAccess = Package member access
|
||||
|
||||
x.in.y={0} in {1}
|
||||
x.implements.y={0} in {1} implements {2} in {3}.
|
||||
x.overrides.y.in.class.list={0} in {1} overrides functions in the following classes/traits: {2} Do you want to {3} the base functions?
|
||||
x.overrides.y.in.class.list={0} in {1} overrides functions in the following classes/interfaces: {2} Do you want to {3} the base functions?
|
||||
|
||||
unused.overriding.methods.title=Unused Overriding Members
|
||||
there.are.unused.methods.that.override.methods.you.delete=There are unused members that override methods you delete.
|
||||
@@ -388,7 +386,6 @@ find.options.include.overloaded.methods.checkbox=Include o&verloaded functions a
|
||||
find.what.functions.usages.checkbox=Usages of &functions
|
||||
find.what.properties.usages.checkbox=Usages of &properties
|
||||
find.what.constructor.usages.checkbox=Usages of &constructor
|
||||
find.what.derived.traits.checkbox=&Derived traits
|
||||
find.what.derived.classes.checkbox=&Derived classes
|
||||
|
||||
hierarchy.legend.member.is.defined.in.class=Member is defined in the class
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ private object DeclarationKindDetector : JetVisitor<AnnotationHostKind?, Unit?>(
|
||||
|
||||
override fun visitDeclaration(d: JetDeclaration, _: Unit?) = null
|
||||
|
||||
override fun visitClass(d: JetClass, _: Unit?) = detect(d, if (d.isInterface()) "trait" else "class")
|
||||
override fun visitClass(d: JetClass, _: Unit?) = detect(d, if (d.isInterface()) "interface" else "class")
|
||||
|
||||
override fun visitNamedFunction(d: JetNamedFunction, _: Unit?) = detect(d, "fun")
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
<internalFileTemplate name="Kotlin File"/>
|
||||
<internalFileTemplate name="Kotlin Class"/>
|
||||
<internalFileTemplate name="Kotlin Enum"/>
|
||||
<internalFileTemplate name="Kotlin Trait"/>
|
||||
<internalFileTemplate name="Kotlin Interface"/>
|
||||
|
||||
<gotoSymbolContributor implementation="org.jetbrains.kotlin.idea.caches.JetGotoSymbolContributor"/>
|
||||
<gotoClassContributor implementation="org.jetbrains.kotlin.idea.caches.JetGotoClassContributor"/>
|
||||
|
||||
@@ -36,7 +36,7 @@ public class JetElementDescriptionProvider : ElementDescriptionProvider {
|
||||
val targetElement = element.unwrapped
|
||||
|
||||
fun elementKind() = when (targetElement) {
|
||||
is JetClass -> if (targetElement.isInterface()) "trait" else "class"
|
||||
is JetClass -> if (targetElement.isInterface()) "interface" else "class"
|
||||
is JetObjectDeclaration -> "object"
|
||||
is JetNamedFunction -> "function"
|
||||
is JetSecondaryConstructor -> "constructor"
|
||||
|
||||
+1
-2
@@ -75,8 +75,7 @@ public class KotlinFindClassUsagesDialog extends FindClassUsagesDialog {
|
||||
findWhatPanel,
|
||||
true
|
||||
);
|
||||
derivedTraits = addCheckboxToPanel(
|
||||
JetBundle.message("find.what.derived.traits.checkbox"),
|
||||
derivedTraits = addCheckboxToPanel("&Derived interfaces",
|
||||
getFindUsagesOptions().isDerivedInterfaces,
|
||||
findWhatPanel,
|
||||
true
|
||||
|
||||
@@ -134,7 +134,7 @@ public class JetColorSettingsPage implements ColorSettingsPage {
|
||||
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.class"), JetHighlightingColors.CLASS),
|
||||
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.type.parameter"), JetHighlightingColors.TYPE_PARAMETER),
|
||||
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.abstract.class"), JetHighlightingColors.ABSTRACT_CLASS),
|
||||
new AttributesDescriptor(JetBundle.message("options.kotlin.attribute.descriptor.trait"), JetHighlightingColors.TRAIT),
|
||||
new AttributesDescriptor("Interface", JetHighlightingColors.TRAIT),
|
||||
new AttributesDescriptor(JetBundle.message("options.kotlin.attribute.descriptor.annotation"), JetHighlightingColors.ANNOTATION),
|
||||
new AttributesDescriptor(JetBundle.message("options.kotlin.attribute.descriptor.object"), JetHighlightingColors.OBJECT),
|
||||
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ public class CreateCallableFromUsageFix(
|
||||
return
|
||||
}
|
||||
|
||||
val popupTitle = JetBundle.message("choose.target.class.or.trait.title")
|
||||
val popupTitle = "Choose target class or interface"
|
||||
val receiverTypeCandidates = callableBuilder.computeTypeCandidates(callableInfo.receiverTypeInfo)
|
||||
if (receiverTypeCandidates.isNotEmpty()) {
|
||||
val containers = receiverTypeCandidates
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ enum class ClassKind(val keyword: String, val description: String) {
|
||||
ENUM_CLASS: ClassKind("enum class", "enum")
|
||||
ENUM_ENTRY: ClassKind("", "enum constant")
|
||||
ANNOTATION_CLASS: ClassKind("annotation class", "annotation")
|
||||
TRAIT: ClassKind("trait", "trait")
|
||||
TRAIT: ClassKind("interface", "interface")
|
||||
OBJECT: ClassKind("object", "object")
|
||||
}
|
||||
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
|
||||
package testData.libraries
|
||||
|
||||
[public trait SimpleTrait {
|
||||
[public interface SimpleTrait {
|
||||
}]
|
||||
|
||||
@@ -9,7 +9,7 @@ package testData.libraries
|
||||
}]]
|
||||
|
||||
[[internal final class MyInner public () {
|
||||
[internal trait MyInnerInner {
|
||||
[internal interface MyInnerInner {
|
||||
[internal abstract fun innerInnerMethod(): kotlin.Unit]
|
||||
}]
|
||||
}]]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// "class com.intellij.codeInsight.daemon.impl.quickfix.ImportClassFixBase" "false"
|
||||
// ACTION: Create annotation 'SomeTest'
|
||||
// ACTION: Create class 'SomeTest'
|
||||
// ACTION: Create interface 'SomeTest'
|
||||
// ACTION: Create enum 'SomeTest'
|
||||
// ACTION: Create object 'SomeTest'
|
||||
// ACTION: Create trait 'SomeTest'
|
||||
// ERROR: Unresolved reference: SomeTest
|
||||
|
||||
package testing
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// "class com.intellij.codeInsight.daemon.impl.quickfix.ImportClassFixBase" "false"
|
||||
// ACTION: Create trait 'SomeTest'
|
||||
// ACTION: Create interface 'SomeTest'
|
||||
// ERROR: Unresolved reference: SomeTest
|
||||
|
||||
package testing
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// "Create class 'A'" "false"
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ERROR: Unresolved reference: A
|
||||
package p
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "false"
|
||||
// "Create interface 'A'" "false"
|
||||
// ERROR: Unresolved reference: A
|
||||
class Foo: J.<caret>A {
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
// ERROR: Unresolved reference: A
|
||||
class Foo: J.A {
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
// ERROR: Unresolved reference: A
|
||||
class Foo: J.<caret>A {
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
package p
|
||||
|
||||
class Foo: <caret>A {
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
package p
|
||||
|
||||
class Foo: A {
|
||||
|
||||
}
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// ACTION: Create annotation 'A'
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create enum 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ERROR: Unresolved reference: A
|
||||
import E.<caret>A
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Create enum constant 'A'" "false"
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ACTION: Create object 'A'
|
||||
// ACTION: Create enum 'A'
|
||||
// ACTION: Create annotation 'A'
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Create enum constant 'A'" "false"
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ACTION: Create object 'A'
|
||||
// ACTION: Create enum 'A'
|
||||
// ACTION: Create annotation 'A'
|
||||
|
||||
+1
-1
@@ -2,8 +2,8 @@
|
||||
// ERROR: Unresolved reference: A
|
||||
// ACTION: Create annotation 'A'
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ACTION: Create enum 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
import J.<caret>A
|
||||
|
||||
class X {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
package p
|
||||
|
||||
import p.<caret>A
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
package p
|
||||
|
||||
import p.A
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
// ERROR: Unresolved reference: A
|
||||
import J.A
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
// ERROR: Unresolved reference: A
|
||||
import J.<caret>A
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
package p
|
||||
|
||||
import p.X.<caret>A
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
package p
|
||||
|
||||
import p.X.A
|
||||
|
||||
class X {
|
||||
trait A {
|
||||
interface A {
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
// ERROR: Unresolved reference: A
|
||||
fun foo() = J.A.B
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
// ERROR: Unresolved reference: A
|
||||
fun foo() = J.<caret>A.B
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
// ERROR: Unresolved reference: B
|
||||
package p
|
||||
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
// ERROR: Unresolved reference: B
|
||||
package p
|
||||
|
||||
fun foo() = A.B
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "false"
|
||||
// "Create interface 'A'" "false"
|
||||
// ACTION: Create object 'A'
|
||||
// ACTION: Create local variable 'A'
|
||||
// ACTION: Create parameter 'A'
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Create annotation 'A'" "false"
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ACTION: Convert to block body
|
||||
// ERROR: Unresolved reference: A
|
||||
package p
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create annotation 'A'" "false"
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create object 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ACTION: Create enum 'A'
|
||||
// ACTION: Convert to block body
|
||||
// ERROR: Unresolved reference: A
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@
|
||||
// ACTION: Create annotation 'A'
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create enum 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ERROR: Unresolved reference: A
|
||||
fun foo(): J.<caret>A = throw Throwable("")
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create enum constant 'A'" "false"
|
||||
// ACTION: Create annotation 'A'
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ACTION: Create enum 'A'
|
||||
// ACTION: Convert to block body
|
||||
// ERROR: Unresolved reference: A
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Create enum 'A'" "false"
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ACTION: Convert to block body
|
||||
// ERROR: Unresolved reference: A
|
||||
package p
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create object 'A'" "false"
|
||||
// ACTION: Create annotation 'A'
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ACTION: Create enum 'A'
|
||||
// ACTION: Convert to block body
|
||||
// ERROR: Unresolved reference: A
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Create object 'A'" "false"
|
||||
// ACTION: Create class 'A'
|
||||
// ACTION: Create trait 'A'
|
||||
// ACTION: Create interface 'A'
|
||||
// ACTION: Convert to block body
|
||||
// ERROR: Unresolved reference: A
|
||||
package p
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
// ERROR: Unresolved reference: A
|
||||
fun foo(): J.A = throw Throwable("")
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
// ERROR: Unresolved reference: A
|
||||
fun foo(): J.<caret>A = throw Throwable("")
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
package p
|
||||
|
||||
fun foo(): <caret>A = throw Throwable("")
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// "Create trait 'A'" "true"
|
||||
// "Create interface 'A'" "true"
|
||||
package p
|
||||
|
||||
fun foo(): A = throw Throwable("")
|
||||
|
||||
trait A {
|
||||
interface A {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for trait C" "true"
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for interface C" "true"
|
||||
|
||||
trait C {
|
||||
var foo: String?<caret>?
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for trait C" "true"
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for interface C" "true"
|
||||
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
trait C {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
// ACTION: Create annotation 'NoSuchType'
|
||||
// ACTION: Create class 'NoSuchType'
|
||||
// ACTION: Create enum 'NoSuchType'
|
||||
// ACTION: Create trait 'NoSuchType'
|
||||
// ACTION: Create interface 'NoSuchType'
|
||||
// ACTION: Remove explicit lambda parameter types (may break code)
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Int</td></tr><tr><td>Found:</td><td>([ERROR : NoSuchType]) → kotlin.Int</td></tr></table></html>
|
||||
// ERROR: Unresolved reference: NoSuchType
|
||||
|
||||
@@ -1 +1 @@
|
||||
trait test.A has 1 usage that is not safe to delete.
|
||||
interface test.A has 1 usage that is not safe to delete.
|
||||
@@ -1 +1 @@
|
||||
fun foo(): kotlin.Unit in final class B : A implements fun foo(): kotlin.Unit in trait A.
|
||||
fun foo(): kotlin.Unit in final class B : A implements fun foo(): kotlin.Unit in interface A.
|
||||
@@ -1,2 +1,2 @@
|
||||
fun foo(): kotlin.Unit in final class B : A, Z implements fun foo(): kotlin.Unit in trait A.
|
||||
fun foo(): kotlin.Unit in final class B : A, Z implements fun foo(): kotlin.Unit in trait Z.
|
||||
fun foo(): kotlin.Unit in final class B : A, Z implements fun foo(): kotlin.Unit in interface A.
|
||||
fun foo(): kotlin.Unit in final class B : A, Z implements fun foo(): kotlin.Unit in interface Z.
|
||||
+1
-1
@@ -1 +1 @@
|
||||
fun foo(): kotlin.Unit in final class B : A, Z implements fun foo(): kotlin.Unit in trait Z.
|
||||
fun foo(): kotlin.Unit in final class B : A, Z implements fun foo(): kotlin.Unit in interface Z.
|
||||
@@ -1 +1 @@
|
||||
val foo: kotlin.String in final class B : A implements val foo: kotlin.String in trait A.
|
||||
val foo: kotlin.String in final class B : A implements val foo: kotlin.String in interface A.
|
||||
@@ -1,2 +1,2 @@
|
||||
val foo: kotlin.String in final class B : A, Z implements val foo: kotlin.String in trait A.
|
||||
val foo: kotlin.String in final class B : A, Z implements val foo: kotlin.String in trait Z.
|
||||
val foo: kotlin.String in final class B : A, Z implements val foo: kotlin.String in interface A.
|
||||
val foo: kotlin.String in final class B : A, Z implements val foo: kotlin.String in interface Z.
|
||||
@@ -1 +1 @@
|
||||
var foo: kotlin.String in final class B : A implements var foo: kotlin.String in trait A.
|
||||
var foo: kotlin.String in final class B : A implements var foo: kotlin.String in interface A.
|
||||
@@ -1,2 +1,2 @@
|
||||
var foo: kotlin.String in final class B : A, Z implements var foo: kotlin.String in trait A.
|
||||
var foo: kotlin.String in final class B : A, Z implements var foo: kotlin.String in trait Z.
|
||||
var foo: kotlin.String in final class B : A, Z implements var foo: kotlin.String in interface A.
|
||||
var foo: kotlin.String in final class B : A, Z implements var foo: kotlin.String in interface Z.
|
||||
+1
-1
@@ -1 +1 @@
|
||||
val foo: kotlin.String in final class B : A, Z implements val foo: kotlin.String in trait Z.
|
||||
val foo: kotlin.String in final class B : A, Z implements val foo: kotlin.String in interface Z.
|
||||
+1
-1
@@ -1 +1 @@
|
||||
var foo: kotlin.String in final class B : A, Z implements var foo: kotlin.String in trait Z.
|
||||
var foo: kotlin.String in final class B : A, Z implements var foo: kotlin.String in interface Z.
|
||||
Reference in New Issue
Block a user