Enum warnings fixed: deprecated delimiters, short super constructors, both in project and in libraries
This commit is contained in:
@@ -21,8 +21,8 @@ import org.jetbrains.org.objectweb.asm.tree.LabelNode
|
|||||||
import org.jetbrains.kotlin.codegen.inline.InlineCodegenUtil.*
|
import org.jetbrains.kotlin.codegen.inline.InlineCodegenUtil.*
|
||||||
|
|
||||||
enum class TryCatchPosition {
|
enum class TryCatchPosition {
|
||||||
START
|
START,
|
||||||
END
|
END,
|
||||||
INNER
|
INNER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import kotlin.properties.Delegates
|
|||||||
|
|
||||||
public data class JavaRoot(public val file: VirtualFile, public val type: JavaRoot.RootType) {
|
public data class JavaRoot(public val file: VirtualFile, public val type: JavaRoot.RootType) {
|
||||||
public enum class RootType {
|
public enum class RootType {
|
||||||
SOURCE
|
SOURCE,
|
||||||
BINARY
|
BINARY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -27,18 +27,18 @@ import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKind.*
|
|||||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||||
|
|
||||||
public enum class MemberKind { FIELD METHOD }
|
public enum class MemberKind { FIELD, METHOD }
|
||||||
|
|
||||||
public data class RawSignature(public val name: String, public val desc: String, public val kind: MemberKind)
|
public data class RawSignature(public val name: String, public val desc: String, public val kind: MemberKind)
|
||||||
|
|
||||||
public enum class JvmDeclarationOriginKind {
|
public enum class JvmDeclarationOriginKind {
|
||||||
OTHER
|
OTHER,
|
||||||
PACKAGE_FACADE
|
PACKAGE_FACADE,
|
||||||
PACKAGE_PART
|
PACKAGE_PART,
|
||||||
TRAIT_IMPL
|
TRAIT_IMPL,
|
||||||
DELEGATION_TO_TRAIT_IMPL
|
DELEGATION_TO_TRAIT_IMPL,
|
||||||
DELEGATION
|
DELEGATION,
|
||||||
BRIDGE
|
BRIDGE,
|
||||||
SYNTHETIC // this means that there's no proper descriptor for this jvm declaration
|
SYNTHETIC // this means that there's no proper descriptor for this jvm declaration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,12 +102,12 @@ public trait ModuleInfo {
|
|||||||
override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>) {
|
override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>) {
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
LAST {
|
LAST {
|
||||||
override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>) {
|
override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>) {
|
||||||
dependencies.add(builtinsModule)
|
dependencies.add(builtinsModule)
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>) {
|
override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>) {
|
||||||
//TODO: KT-5457
|
//TODO: KT-5457
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ public fun traverseFollowingInstructions(
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum class TraversalOrder {
|
public enum class TraversalOrder {
|
||||||
FORWARD
|
FORWARD,
|
||||||
BACKWARD
|
BACKWARD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-15
@@ -132,23 +132,23 @@ public class MagicInstruction(
|
|||||||
|
|
||||||
public enum class MagicKind(val sideEffectFree: Boolean = false) {
|
public enum class MagicKind(val sideEffectFree: Boolean = false) {
|
||||||
// builtin operations
|
// builtin operations
|
||||||
STRING_TEMPLATE: MagicKind(true)
|
STRING_TEMPLATE(true),
|
||||||
AND: MagicKind(true)
|
AND(true),
|
||||||
OR: MagicKind(true)
|
OR(true),
|
||||||
NOT_NULL_ASSERTION: MagicKind()
|
NOT_NULL_ASSERTION(),
|
||||||
EQUALS_IN_WHEN_CONDITION: MagicKind()
|
EQUALS_IN_WHEN_CONDITION(),
|
||||||
IS: MagicKind()
|
IS(),
|
||||||
CAST: MagicKind()
|
CAST(),
|
||||||
CALLABLE_REFERENCE: MagicKind(true)
|
CALLABLE_REFERENCE(true),
|
||||||
// implicit operations
|
// implicit operations
|
||||||
LOOP_RANGE_ITERATION: MagicKind()
|
LOOP_RANGE_ITERATION(),
|
||||||
IMPLICIT_RECEIVER: MagicKind()
|
IMPLICIT_RECEIVER(),
|
||||||
VALUE_CONSUMER: MagicKind()
|
VALUE_CONSUMER(),
|
||||||
// unrecognized operations
|
// unrecognized operations
|
||||||
UNRESOLVED_CALL: MagicKind()
|
UNRESOLVED_CALL(),
|
||||||
UNSUPPORTED_ELEMENT: MagicKind()
|
UNSUPPORTED_ELEMENT(),
|
||||||
UNRECOGNIZED_WRITE_RHS: MagicKind()
|
UNRECOGNIZED_WRITE_RHS(),
|
||||||
FAKE_INITIALIZER: MagicKind()
|
FAKE_INITIALIZER()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merges values produced by alternative control-flow paths (such as 'if' branches)
|
// Merges values produced by alternative control-flow paths (such as 'if' branches)
|
||||||
|
|||||||
@@ -374,18 +374,18 @@ public class JetPsiFactory(private val project: Project) {
|
|||||||
|
|
||||||
public class CallableBuilder(private val target: Target) {
|
public class CallableBuilder(private val target: Target) {
|
||||||
public enum class Target {
|
public enum class Target {
|
||||||
FUNCTION
|
FUNCTION,
|
||||||
READ_ONLY_PROPERTY
|
READ_ONLY_PROPERTY
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class State {
|
enum class State {
|
||||||
MODIFIERS
|
MODIFIERS,
|
||||||
NAME
|
NAME,
|
||||||
RECEIVER
|
RECEIVER,
|
||||||
FIRST_PARAM
|
FIRST_PARAM,
|
||||||
REST_PARAMS
|
REST_PARAMS,
|
||||||
TYPE_CONSTRAINTS
|
TYPE_CONSTRAINTS,
|
||||||
BODY
|
BODY,
|
||||||
DONE
|
DONE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ public object ArgumentUnmapped: ArgumentMapping {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum class ArgumentMatchStatus(val isError: Boolean = true) {
|
public enum class ArgumentMatchStatus(val isError: Boolean = true) {
|
||||||
SUCCESS : ArgumentMatchStatus(false)
|
SUCCESS(false),
|
||||||
TYPE_MISMATCH : ArgumentMatchStatus()
|
TYPE_MISMATCH(),
|
||||||
ARGUMENT_HAS_NO_TYPE : ArgumentMatchStatus()
|
ARGUMENT_HAS_NO_TYPE(),
|
||||||
|
|
||||||
// The case when there is no type mismatch, but parameter has uninferred types:
|
// The case when there is no type mismatch, but parameter has uninferred types:
|
||||||
// fun <T> foo(l: List<T>) {}; val l = foo(emptyList())
|
// fun <T> foo(l: List<T>) {}; val l = foo(emptyList())
|
||||||
MATCH_MODULO_UNINFERRED_TYPES : ArgumentMatchStatus()
|
MATCH_MODULO_UNINFERRED_TYPES()
|
||||||
}
|
}
|
||||||
|
|
||||||
public trait ArgumentMatch : ArgumentMapping {
|
public trait ArgumentMatch : ArgumentMapping {
|
||||||
|
|||||||
@@ -226,8 +226,8 @@ class LazyImportScope(
|
|||||||
) : JetScope {
|
) : JetScope {
|
||||||
|
|
||||||
enum class FilteringKind {
|
enum class FilteringKind {
|
||||||
ALL
|
ALL,
|
||||||
VISIBLE_CLASSES
|
VISIBLE_CLASSES,
|
||||||
INVISIBLE_CLASSES
|
INVISIBLE_CLASSES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import org.jetbrains.kotlin.name.Name
|
|||||||
|
|
||||||
public trait WritableScope : JetScope {
|
public trait WritableScope : JetScope {
|
||||||
public enum class LockLevel {
|
public enum class LockLevel {
|
||||||
WRITING
|
WRITING,
|
||||||
BOTH
|
BOTH,
|
||||||
READING
|
READING
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -118,7 +118,7 @@ abstract public class AbstractConstraintSystemTest() : JetLiteFixture() {
|
|||||||
|
|
||||||
class MyConstraint(val kind: MyConstraintKind, val firstType: String, val secondType: String, val isWeak: Boolean)
|
class MyConstraint(val kind: MyConstraintKind, val firstType: String, val secondType: String, val isWeak: Boolean)
|
||||||
enum class MyConstraintKind {
|
enum class MyConstraintKind {
|
||||||
SUBTYPE SUPERTYPE
|
SUBTYPE, SUPERTYPE
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun parseVariables(text: String): List<String> {
|
private fun parseVariables(text: String): List<String> {
|
||||||
|
|||||||
+2
-2
@@ -357,8 +357,8 @@ trait JavaTypeAttributes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class JavaTypeFlexibility {
|
enum class JavaTypeFlexibility {
|
||||||
INFLEXIBLE
|
INFLEXIBLE,
|
||||||
FLEXIBLE_UPPER_BOUND
|
FLEXIBLE_UPPER_BOUND,
|
||||||
FLEXIBLE_LOWER_BOUND
|
FLEXIBLE_LOWER_BOUND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -44,8 +44,8 @@ public class KotlinClassHeader(
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum class Kind {
|
public enum class Kind {
|
||||||
CLASS
|
CLASS,
|
||||||
PACKAGE_FACADE
|
PACKAGE_FACADE,
|
||||||
SYNTHETIC_CLASS
|
SYNTHETIC_CLASS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ public fun FqName.tail(prefix: FqName): FqName {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private enum class State {
|
private enum class State {
|
||||||
BEGINNING
|
BEGINNING,
|
||||||
MIDDLE
|
MIDDLE,
|
||||||
AFTER_DOT
|
AFTER_DOT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -19,13 +19,13 @@ package org.jetbrains.kotlin.resolve.calls.inference.constraintPosition
|
|||||||
import org.jetbrains.kotlin.resolve.calls.inference.constraintPosition.ConstraintPositionKind.*
|
import org.jetbrains.kotlin.resolve.calls.inference.constraintPosition.ConstraintPositionKind.*
|
||||||
|
|
||||||
public enum class ConstraintPositionKind {
|
public enum class ConstraintPositionKind {
|
||||||
RECEIVER_POSITION
|
RECEIVER_POSITION,
|
||||||
EXPECTED_TYPE_POSITION
|
EXPECTED_TYPE_POSITION,
|
||||||
VALUE_PARAMETER_POSITION
|
VALUE_PARAMETER_POSITION,
|
||||||
TYPE_BOUND_POSITION
|
TYPE_BOUND_POSITION,
|
||||||
COMPOUND_CONSTRAINT_POSITION
|
COMPOUND_CONSTRAINT_POSITION,
|
||||||
FROM_COMPLETER
|
FROM_COMPLETER,
|
||||||
SPECIAL
|
SPECIAL;
|
||||||
|
|
||||||
public fun position(): ConstraintPosition {
|
public fun position(): ConstraintPosition {
|
||||||
assert(this in setOf(RECEIVER_POSITION, EXPECTED_TYPE_POSITION, FROM_COMPLETER, SPECIAL))
|
assert(this in setOf(RECEIVER_POSITION, EXPECTED_TYPE_POSITION, FROM_COMPLETER, SPECIAL))
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ import org.jetbrains.kotlin.types.TypeSubstitution
|
|||||||
public class ConstraintSystemImpl : ConstraintSystem {
|
public class ConstraintSystemImpl : ConstraintSystem {
|
||||||
|
|
||||||
public enum class ConstraintKind {
|
public enum class ConstraintKind {
|
||||||
SUB_TYPE
|
SUB_TYPE,
|
||||||
EQUAL
|
EQUAL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ public trait TypeBounds {
|
|||||||
public fun getValues(): Collection<JetType>
|
public fun getValues(): Collection<JetType>
|
||||||
|
|
||||||
public enum class BoundKind {
|
public enum class BoundKind {
|
||||||
LOWER_BOUND
|
LOWER_BOUND,
|
||||||
UPPER_BOUND
|
UPPER_BOUND,
|
||||||
EXACT_BOUND
|
EXACT_BOUND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ public trait TypeCapability
|
|||||||
public trait Specificity : TypeCapability {
|
public trait Specificity : TypeCapability {
|
||||||
|
|
||||||
public enum class Relation {
|
public enum class Relation {
|
||||||
LESS_SPECIFIC
|
LESS_SPECIFIC,
|
||||||
MORE_SPECIFIC
|
MORE_SPECIFIC,
|
||||||
DONT_KNOW
|
DONT_KNOW
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ public enum class Variance(
|
|||||||
public val allowsOutPosition: Boolean,
|
public val allowsOutPosition: Boolean,
|
||||||
private val superpositionFactor: Int
|
private val superpositionFactor: Int
|
||||||
) {
|
) {
|
||||||
INVARIANT : Variance("", true, true, 0)
|
INVARIANT("", true, true, 0),
|
||||||
IN_VARIANCE : Variance("in", true, false, -1)
|
IN_VARIANCE("in", true, false, -1),
|
||||||
OUT_VARIANCE : Variance("out", false, true, +1)
|
OUT_VARIANCE("out", false, true, +1);
|
||||||
|
|
||||||
public fun allowsPosition(position: Variance): Boolean
|
public fun allowsPosition(position: Variance): Boolean
|
||||||
= when (position) {
|
= when (position) {
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ public abstract class DeserializedMemberScope protected(
|
|||||||
) : JetScope {
|
) : JetScope {
|
||||||
|
|
||||||
private data class ProtoKey(val name: Name, val kind: Kind, val isExtension: Boolean)
|
private data class ProtoKey(val name: Name, val kind: Kind, val isExtension: Boolean)
|
||||||
private enum class Kind { FUNCTION PROPERTY }
|
private enum class Kind { FUNCTION, PROPERTY }
|
||||||
|
|
||||||
private fun CallableKind.toKind(): Kind {
|
private fun CallableKind.toKind(): Kind {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ public class ExceptionThrown(public val exception: ObjectValue, public val kind:
|
|||||||
override fun toString(): String = "Thrown $exception: $kind"
|
override fun toString(): String = "Thrown $exception: $kind"
|
||||||
|
|
||||||
public enum class ExceptionKind {
|
public enum class ExceptionKind {
|
||||||
FROM_EVALUATED_CODE
|
FROM_EVALUATED_CODE,
|
||||||
FROM_EVALUATOR
|
FROM_EVALUATOR,
|
||||||
BROKEN_CODE
|
BROKEN_CODE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ import org.jetbrains.kotlin.generators.builtins.ProgressionKind.*
|
|||||||
import kotlin.properties.Delegates
|
import kotlin.properties.Delegates
|
||||||
|
|
||||||
enum class PrimitiveType {
|
enum class PrimitiveType {
|
||||||
BYTE
|
BYTE,
|
||||||
CHAR
|
CHAR,
|
||||||
SHORT
|
SHORT,
|
||||||
INT
|
INT,
|
||||||
LONG
|
LONG,
|
||||||
FLOAT
|
FLOAT,
|
||||||
DOUBLE
|
DOUBLE,
|
||||||
BOOLEAN
|
BOOLEAN;
|
||||||
|
|
||||||
val capitalized: String get() = name().toLowerCase().capitalize()
|
val capitalized: String get() = name().toLowerCase().capitalize()
|
||||||
companion object {
|
companion object {
|
||||||
@@ -36,13 +36,13 @@ enum class PrimitiveType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class ProgressionKind {
|
enum class ProgressionKind {
|
||||||
BYTE
|
BYTE,
|
||||||
CHAR
|
CHAR,
|
||||||
SHORT
|
SHORT,
|
||||||
INT
|
INT,
|
||||||
LONG
|
LONG,
|
||||||
FLOAT
|
FLOAT,
|
||||||
DOUBLE
|
DOUBLE;
|
||||||
|
|
||||||
val capitalized: String get() = name().toLowerCase().capitalize()
|
val capitalized: String get() = name().toLowerCase().capitalize()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,12 +28,12 @@ enum class FunctionKind(
|
|||||||
val hasReceiverParameter: Boolean,
|
val hasReceiverParameter: Boolean,
|
||||||
private val superClassNamePrefix: String?
|
private val superClassNamePrefix: String?
|
||||||
) {
|
) {
|
||||||
FUNCTION : FunctionKind("Function", "A function", false, null)
|
FUNCTION("Function", "A function", false, null),
|
||||||
EXTENSION_FUNCTION : FunctionKind("ExtensionFunction", "An extension function", true, null)
|
EXTENSION_FUNCTION("ExtensionFunction", "An extension function", true, null),
|
||||||
|
|
||||||
K_FUNCTION : FunctionKind("KFunction", "A function with introspection capabilities", false, "Function")
|
K_FUNCTION("KFunction", "A function with introspection capabilities", false, "Function"),
|
||||||
K_MEMBER_FUNCTION : FunctionKind("KMemberFunction", "A member function with introspection capabilities", true, "ExtensionFunction")
|
K_MEMBER_FUNCTION("KMemberFunction", "A member function with introspection capabilities", true, "ExtensionFunction"),
|
||||||
K_EXTENSION_FUNCTION : FunctionKind("KExtensionFunction", "An extension function with introspection capabilities", true, "ExtensionFunction")
|
K_EXTENSION_FUNCTION("KExtensionFunction", "An extension function with introspection capabilities", true, "ExtensionFunction");
|
||||||
|
|
||||||
fun getFileName() = (if (isReflection()) "reflect/" else "") + classNamePrefix + "s.kt"
|
fun getFileName() = (if (isReflection()) "reflect/" else "") + classNamePrefix + "s.kt"
|
||||||
fun getClassName(i: Int) = classNamePrefix + i
|
fun getClassName(i: Int) = classNamePrefix + i
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class FuzzyType(
|
|||||||
= matchedSubstitutor(otherType, MatchKind.IS_SUPERTYPE)
|
= matchedSubstitutor(otherType, MatchKind.IS_SUPERTYPE)
|
||||||
|
|
||||||
private enum class MatchKind {
|
private enum class MatchKind {
|
||||||
IS_SUBTYPE
|
IS_SUBTYPE,
|
||||||
IS_SUPERTYPE
|
IS_SUPERTYPE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ private fun JetType.hasAnnotationMaybeExternal(fqName: FqName) = with (getAnnota
|
|||||||
} != null
|
} != null
|
||||||
|
|
||||||
public enum class TypeNullability {
|
public enum class TypeNullability {
|
||||||
NOT_NULL
|
NOT_NULL,
|
||||||
NULLABLE
|
NULLABLE,
|
||||||
FLEXIBLE
|
FLEXIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,18 +26,18 @@ import org.jetbrains.kotlin.resolve.calls.smartcasts.SmartCastUtils
|
|||||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||||
|
|
||||||
public enum class CallType {
|
public enum class CallType {
|
||||||
NORMAL
|
NORMAL,
|
||||||
SAFE
|
SAFE,
|
||||||
|
|
||||||
INFIX {
|
INFIX {
|
||||||
override fun canCall(descriptor: DeclarationDescriptor)
|
override fun canCall(descriptor: DeclarationDescriptor)
|
||||||
= descriptor is SimpleFunctionDescriptor && descriptor.getValueParameters().size() == 1
|
= descriptor is SimpleFunctionDescriptor && descriptor.getValueParameters().size() == 1
|
||||||
}
|
},
|
||||||
|
|
||||||
UNARY {
|
UNARY {
|
||||||
override fun canCall(descriptor: DeclarationDescriptor)
|
override fun canCall(descriptor: DeclarationDescriptor)
|
||||||
= descriptor is SimpleFunctionDescriptor && descriptor.getValueParameters().size() == 0
|
= descriptor is SimpleFunctionDescriptor && descriptor.getValueParameters().size() == 0
|
||||||
}
|
};
|
||||||
|
|
||||||
public open fun canCall(descriptor: DeclarationDescriptor): Boolean = true
|
public open fun canCall(descriptor: DeclarationDescriptor): Boolean = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package org.jetbrains.kotlin.resolve.lazy
|
package org.jetbrains.kotlin.resolve.lazy
|
||||||
|
|
||||||
public enum class BodyResolveMode {
|
public enum class BodyResolveMode {
|
||||||
FULL
|
FULL,
|
||||||
PARTIAL
|
PARTIAL,
|
||||||
PARTIAL_FOR_COMPLETION
|
PARTIAL_FOR_COMPLETION
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -531,9 +531,9 @@ class PartialBodyResolveFilter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private enum class MarkLevel {
|
private enum class MarkLevel {
|
||||||
SKIP
|
SKIP,
|
||||||
TAKE
|
TAKE,
|
||||||
NEED_REFERENCE_RESOLVE
|
NEED_REFERENCE_RESOLVE,
|
||||||
NEED_COMPLETION
|
NEED_COMPLETION
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class ModuleTypeCacheManager private (project: Project) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class ModuleType {
|
enum class ModuleType {
|
||||||
GRADLE
|
GRADLE,
|
||||||
OTHER
|
OTHER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -118,7 +118,7 @@ enum class FlagsToModifiers {
|
|||||||
else -> throw IllegalStateException("Unexpected modality: $modality")
|
else -> throw IllegalStateException("Unexpected modality: $modality")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
VISIBILITY {
|
VISIBILITY {
|
||||||
override fun getModifiers(flags: Int): JetModifierKeywordToken? {
|
override fun getModifiers(flags: Int): JetModifierKeywordToken? {
|
||||||
@@ -131,13 +131,13 @@ enum class FlagsToModifiers {
|
|||||||
else -> throw IllegalStateException("Unexpected visibility: $visibility")
|
else -> throw IllegalStateException("Unexpected visibility: $visibility")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
INNER {
|
INNER {
|
||||||
override fun getModifiers(flags: Int): JetModifierKeywordToken? {
|
override fun getModifiers(flags: Int): JetModifierKeywordToken? {
|
||||||
return if (Flags.INNER.get(flags)) JetTokens.INNER_KEYWORD else null
|
return if (Flags.INNER.get(flags)) JetTokens.INNER_KEYWORD else null
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract fun getModifiers(flags: Int): JetModifierKeywordToken?
|
abstract fun getModifiers(flags: Int): JetModifierKeywordToken?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,39 +224,39 @@ public object UsageTypeUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class UsageTypeEnum {
|
enum class UsageTypeEnum {
|
||||||
TYPE_CONSTRAINT
|
TYPE_CONSTRAINT,
|
||||||
VALUE_PARAMETER_TYPE
|
VALUE_PARAMETER_TYPE,
|
||||||
NON_LOCAL_PROPERTY_TYPE
|
NON_LOCAL_PROPERTY_TYPE,
|
||||||
FUNCTION_RETURN_TYPE
|
FUNCTION_RETURN_TYPE,
|
||||||
SUPER_TYPE
|
SUPER_TYPE,
|
||||||
TYPE_DEFINITION
|
TYPE_DEFINITION,
|
||||||
IS
|
IS,
|
||||||
CLASS_OBJECT_ACCESS
|
CLASS_OBJECT_ACCESS,
|
||||||
COMPANION_OBJECT_ACCESS
|
COMPANION_OBJECT_ACCESS,
|
||||||
EXTENSION_RECEIVER_TYPE
|
EXTENSION_RECEIVER_TYPE,
|
||||||
SUPER_TYPE_QUALIFIER
|
SUPER_TYPE_QUALIFIER,
|
||||||
|
|
||||||
FUNCTION_CALL
|
FUNCTION_CALL,
|
||||||
IMPLICIT_GET
|
IMPLICIT_GET,
|
||||||
IMPLICIT_SET
|
IMPLICIT_SET,
|
||||||
IMPLICIT_INVOKE
|
IMPLICIT_INVOKE,
|
||||||
IMPLICIT_ITERATION
|
IMPLICIT_ITERATION,
|
||||||
PROPERTY_DELEGATION
|
PROPERTY_DELEGATION,
|
||||||
|
|
||||||
RECEIVER
|
RECEIVER,
|
||||||
DELEGATE
|
DELEGATE,
|
||||||
|
|
||||||
PACKAGE_DIRECTIVE
|
PACKAGE_DIRECTIVE,
|
||||||
PACKAGE_MEMBER_ACCESS
|
PACKAGE_MEMBER_ACCESS,
|
||||||
|
|
||||||
CALLABLE_REFERENCE
|
CALLABLE_REFERENCE,
|
||||||
|
|
||||||
READ
|
READ,
|
||||||
WRITE
|
WRITE,
|
||||||
CLASS_IMPORT
|
CLASS_IMPORT,
|
||||||
CLASS_LOCAL_VAR_DECLARATION
|
CLASS_LOCAL_VAR_DECLARATION,
|
||||||
TYPE_PARAMETER
|
TYPE_PARAMETER,
|
||||||
CLASS_CAST_TO
|
CLASS_CAST_TO,
|
||||||
ANNOTATION
|
ANNOTATION,
|
||||||
CLASS_NEW_OPERATOR
|
CLASS_NEW_OPERATOR
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -134,8 +134,8 @@ public class JetSimpleNameReference(
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum class ShorteningMode {
|
public enum class ShorteningMode {
|
||||||
NO_SHORTENING
|
NO_SHORTENING,
|
||||||
DELAYED_SHORTENING
|
DELAYED_SHORTENING,
|
||||||
FORCED_SHORTENING
|
FORCED_SHORTENING
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ public abstract class ImportInsertHelper {
|
|||||||
public abstract val importSortComparator: Comparator<ImportPath>
|
public abstract val importSortComparator: Comparator<ImportPath>
|
||||||
|
|
||||||
public enum class ImportDescriptorResult {
|
public enum class ImportDescriptorResult {
|
||||||
FAIL
|
FAIL,
|
||||||
IMPORT_ADDED
|
IMPORT_ADDED,
|
||||||
ALREADY_IMPORTED
|
ALREADY_IMPORTED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,8 +121,8 @@ public class ShortenReferences(val options: (JetElement) -> Options = { Options.
|
|||||||
}
|
}
|
||||||
|
|
||||||
private enum class FilterResult {
|
private enum class FilterResult {
|
||||||
SKIP
|
SKIP,
|
||||||
GO_INSIDE
|
GO_INSIDE,
|
||||||
PROCESS
|
PROCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -241,11 +241,11 @@ class BasicCompletionSession(configuration: CompletionSessionConfiguration,
|
|||||||
: CompletionSessionBase(configuration, parameters, resultSet) {
|
: CompletionSessionBase(configuration, parameters, resultSet) {
|
||||||
|
|
||||||
public enum class CompletionKind {
|
public enum class CompletionKind {
|
||||||
KEYWORDS_ONLY
|
KEYWORDS_ONLY,
|
||||||
NAMED_PARAMETERS_ONLY
|
NAMED_PARAMETERS_ONLY,
|
||||||
ALL
|
ALL,
|
||||||
TYPES
|
TYPES,
|
||||||
ANNOTATION_TYPES
|
ANNOTATION_TYPES,
|
||||||
ANNOTATION_TYPES_OR_PARAMETER_NAME
|
ANNOTATION_TYPES_OR_PARAMETER_NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -69,10 +69,10 @@ private object SmartCompletionPriorityWeigher : LookupElementWeigher("kotlin.sma
|
|||||||
|
|
||||||
private object KindWeigher : LookupElementWeigher("kotlin.kind") {
|
private object KindWeigher : LookupElementWeigher("kotlin.kind") {
|
||||||
private enum class Weight {
|
private enum class Weight {
|
||||||
variable // variable or property
|
variable, // variable or property
|
||||||
function
|
function,
|
||||||
keyword
|
keyword,
|
||||||
`default`
|
`default`,
|
||||||
packages
|
packages
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,13 +124,13 @@ private class JetDeclarationRemotenessWeigher(private val file: JetFile) : Looku
|
|||||||
private val importCache = ImportCache()
|
private val importCache = ImportCache()
|
||||||
|
|
||||||
private enum class Weight {
|
private enum class Weight {
|
||||||
thisFile
|
thisFile,
|
||||||
kotlinDefaultImport
|
kotlinDefaultImport,
|
||||||
preciseImport
|
preciseImport,
|
||||||
allUnderImport
|
allUnderImport,
|
||||||
`default`
|
`default`,
|
||||||
hasImportFromSamePackage
|
hasImportFromSamePackage,
|
||||||
notImported
|
notImported,
|
||||||
notToBeUsedInKotlin
|
notToBeUsedInKotlin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ import org.jetbrains.kotlin.types.typeUtil.equalTypesOrNulls
|
|||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
|
|
||||||
enum class ItemPriority {
|
enum class ItemPriority {
|
||||||
MULTIPLE_ARGUMENTS_ITEM
|
MULTIPLE_ARGUMENTS_ITEM,
|
||||||
DEFAULT
|
DEFAULT,
|
||||||
BACKING_FIELD
|
BACKING_FIELD,
|
||||||
NAMED_PARAMETER
|
NAMED_PARAMETER
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,12 +125,12 @@ fun LookupElementPresentation.prependTailText(text: String, grayed: Boolean) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class CallableWeight {
|
enum class CallableWeight {
|
||||||
local // local non-extension
|
local, // local non-extension
|
||||||
thisClassMember
|
thisClassMember,
|
||||||
baseClassMember
|
baseClassMember,
|
||||||
thisTypeExtension
|
thisTypeExtension,
|
||||||
baseTypeExtension
|
baseTypeExtension,
|
||||||
global // global non-extension
|
global, // global non-extension
|
||||||
notApplicableReceiverNullable
|
notApplicableReceiverNullable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ import org.jetbrains.kotlin.types.typeUtil.isSubtypeOf
|
|||||||
import java.util.HashSet
|
import java.util.HashSet
|
||||||
|
|
||||||
enum class Tail {
|
enum class Tail {
|
||||||
COMMA
|
COMMA,
|
||||||
RPARENTH
|
RPARENTH,
|
||||||
ELSE
|
ELSE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -92,8 +92,8 @@ public class LookupElementFactory(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private enum class Style {
|
private enum class Style {
|
||||||
NORMAL
|
NORMAL,
|
||||||
BOLD
|
BOLD,
|
||||||
GRAYED
|
GRAYED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -281,19 +281,19 @@ fun <T : Any> T?.toList(): List<T> = if (this != null) listOf(this) else listOf(
|
|||||||
fun <T : Any> T?.toSet(): Set<T> = if (this != null) setOf(this) else setOf()
|
fun <T : Any> T?.toSet(): Set<T> = if (this != null) setOf(this) else setOf()
|
||||||
|
|
||||||
enum class SmartCompletionItemPriority {
|
enum class SmartCompletionItemPriority {
|
||||||
IT
|
IT,
|
||||||
TRUE
|
TRUE,
|
||||||
FALSE
|
FALSE,
|
||||||
THIS
|
THIS,
|
||||||
DEFAULT
|
DEFAULT,
|
||||||
NULLABLE
|
NULLABLE,
|
||||||
INSTANTIATION
|
INSTANTIATION,
|
||||||
STATIC_MEMBER
|
STATIC_MEMBER,
|
||||||
ANONYMOUS_OBJECT
|
ANONYMOUS_OBJECT,
|
||||||
LAMBDA_NO_PARAMS
|
LAMBDA_NO_PARAMS,
|
||||||
LAMBDA
|
LAMBDA,
|
||||||
FUNCTION_REFERENCE
|
FUNCTION_REFERENCE,
|
||||||
NULL
|
NULL,
|
||||||
INHERITOR_INSTANTIATION
|
INHERITOR_INSTANTIATION
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.jetbrains.kotlin.idea.test.ProjectDescriptorWithStdlibSources
|
|||||||
import org.jetbrains.kotlin.psi.JetFile
|
import org.jetbrains.kotlin.psi.JetFile
|
||||||
|
|
||||||
public enum class ModuleKind {
|
public enum class ModuleKind {
|
||||||
KOTLIN_JVM_WITH_STDLIB_SOURCES
|
KOTLIN_JVM_WITH_STDLIB_SOURCES,
|
||||||
KOTLIN_JAVASCRIPT
|
KOTLIN_JAVASCRIPT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ public class JetAddImportAction(
|
|||||||
private val module = ModuleUtilCore.findModuleForPsiElement(element)
|
private val module = ModuleUtilCore.findModuleForPsiElement(element)
|
||||||
|
|
||||||
private enum class Priority {
|
private enum class Priority {
|
||||||
MODULE
|
MODULE,
|
||||||
PROJECT
|
PROJECT,
|
||||||
OTHER
|
OTHER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,11 +61,11 @@ public class KotlinReferenceData(
|
|||||||
) : Cloneable, Serializable {
|
) : Cloneable, Serializable {
|
||||||
|
|
||||||
public enum class Kind {
|
public enum class Kind {
|
||||||
CLASS
|
CLASS,
|
||||||
PACKAGE
|
PACKAGE,
|
||||||
NON_EXTENSION_CALLABLE
|
NON_EXTENSION_CALLABLE,
|
||||||
EXTENSION_FUNCTION
|
EXTENSION_FUNCTION,
|
||||||
EXTENSION_PROPERTY
|
EXTENSION_PROPERTY;
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
public fun fromDescriptor(descriptor: DeclarationDescriptor): KotlinReferenceData.Kind? {
|
public fun fromDescriptor(descriptor: DeclarationDescriptor): KotlinReferenceData.Kind? {
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ public class J2kPostProcessor(private val formatCode: Boolean) : PostProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private enum class RangeFilterResult {
|
private enum class RangeFilterResult {
|
||||||
SKIP
|
SKIP,
|
||||||
GO_INSIDE
|
GO_INSIDE,
|
||||||
PROCESS
|
PROCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -119,9 +119,9 @@ class ParameterInfo(
|
|||||||
)
|
)
|
||||||
|
|
||||||
enum class CallableKind {
|
enum class CallableKind {
|
||||||
FUNCTION
|
FUNCTION,
|
||||||
CLASS_WITH_PRIMARY_CONSTRUCTOR
|
CLASS_WITH_PRIMARY_CONSTRUCTOR,
|
||||||
SECONDARY_CONSTRUCTOR
|
SECONDARY_CONSTRUCTOR,
|
||||||
PROPERTY
|
PROPERTY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -40,12 +40,12 @@ import java.util.Collections
|
|||||||
import java.util.HashMap
|
import java.util.HashMap
|
||||||
|
|
||||||
enum class ClassKind(val keyword: String, val description: String) {
|
enum class ClassKind(val keyword: String, val description: String) {
|
||||||
PLAIN_CLASS: ClassKind("class", "class")
|
PLAIN_CLASS("class", "class"),
|
||||||
ENUM_CLASS: ClassKind("enum class", "enum")
|
ENUM_CLASS("enum class", "enum"),
|
||||||
ENUM_ENTRY: ClassKind("", "enum constant")
|
ENUM_ENTRY("", "enum constant"),
|
||||||
ANNOTATION_CLASS: ClassKind("annotation class", "annotation")
|
ANNOTATION_CLASS("annotation class", "annotation"),
|
||||||
TRAIT: ClassKind("interface", "interface")
|
TRAIT("interface", "interface"),
|
||||||
OBJECT: ClassKind("object", "object")
|
OBJECT("object", "object")
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ClassInfo(
|
public class ClassInfo(
|
||||||
|
|||||||
+3
-3
@@ -27,9 +27,9 @@ import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
|||||||
|
|
||||||
public trait JetMethodDescriptor : MethodDescriptor<JetParameterInfo, Visibility> {
|
public trait JetMethodDescriptor : MethodDescriptor<JetParameterInfo, Visibility> {
|
||||||
enum class Kind(val isConstructor: Boolean) {
|
enum class Kind(val isConstructor: Boolean) {
|
||||||
FUNCTION: Kind(false)
|
FUNCTION(false),
|
||||||
PRIMARY_CONSTRUCTOR: Kind(true)
|
PRIMARY_CONSTRUCTOR(true),
|
||||||
SECONDARY_CONSTRUCTOR: Kind(true)
|
SECONDARY_CONSTRUCTOR(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
val kind: Kind get() {
|
val kind: Kind get() {
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import com.intellij.lang.ASTNode
|
|||||||
import org.jetbrains.kotlin.lexer.JetTokens
|
import org.jetbrains.kotlin.lexer.JetTokens
|
||||||
|
|
||||||
public enum class JetValVar(val name: String) {
|
public enum class JetValVar(val name: String) {
|
||||||
None: JetValVar("none")
|
None("none"),
|
||||||
Val: JetValVar("val")
|
Val("val"),
|
||||||
Var: JetValVar("var")
|
Var("var");
|
||||||
|
|
||||||
override fun toString(): String = name
|
override fun toString(): String = name
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-22
@@ -310,17 +310,17 @@ data class ExtractableCodeDescriptor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class ExtractionTarget(val name: String) {
|
enum class ExtractionTarget(val name: String) {
|
||||||
FUNCTION : ExtractionTarget("function") {
|
FUNCTION("function") {
|
||||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor) = true
|
override fun isAvailable(descriptor: ExtractableCodeDescriptor) = true
|
||||||
}
|
},
|
||||||
|
|
||||||
FAKE_LAMBDALIKE_FUNCTION : ExtractionTarget("lambda parameter") {
|
FAKE_LAMBDALIKE_FUNCTION("lambda parameter") {
|
||||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
||||||
return checkSimpleControlFlow(descriptor) || descriptor.controlFlow.outputValues.isEmpty()
|
return checkSimpleControlFlow(descriptor) || descriptor.controlFlow.outputValues.isEmpty()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
PROPERTY_WITH_INITIALIZER : ExtractionTarget("property with initializer") {
|
PROPERTY_WITH_INITIALIZER("property with initializer") {
|
||||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
||||||
return checkSignatureAndParent(descriptor)
|
return checkSignatureAndParent(descriptor)
|
||||||
&& checkSimpleControlFlow(descriptor)
|
&& checkSimpleControlFlow(descriptor)
|
||||||
@@ -328,22 +328,22 @@ enum class ExtractionTarget(val name: String) {
|
|||||||
&& checkNotTrait(descriptor)
|
&& checkNotTrait(descriptor)
|
||||||
&& descriptor.receiverParameter == null
|
&& descriptor.receiverParameter == null
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
PROPERTY_WITH_GETTER : ExtractionTarget("property with getter") {
|
PROPERTY_WITH_GETTER("property with getter") {
|
||||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
||||||
return checkSignatureAndParent(descriptor)
|
return checkSignatureAndParent(descriptor)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
LAZY_PROPERTY : ExtractionTarget("lazy property") {
|
LAZY_PROPERTY("lazy property") {
|
||||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
||||||
return checkSignatureAndParent(descriptor)
|
return checkSignatureAndParent(descriptor)
|
||||||
&& checkSimpleControlFlow(descriptor)
|
&& checkSimpleControlFlow(descriptor)
|
||||||
&& checkNotTrait(descriptor)
|
&& checkNotTrait(descriptor)
|
||||||
&& descriptor.receiverParameter == null
|
&& descriptor.receiverParameter == null
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean
|
abstract fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean
|
||||||
|
|
||||||
@@ -407,22 +407,22 @@ class AnalysisResult (
|
|||||||
val messages: List<ErrorMessage>
|
val messages: List<ErrorMessage>
|
||||||
) {
|
) {
|
||||||
enum class Status {
|
enum class Status {
|
||||||
SUCCESS
|
SUCCESS,
|
||||||
NON_CRITICAL_ERROR
|
NON_CRITICAL_ERROR,
|
||||||
CRITICAL_ERROR
|
CRITICAL_ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class ErrorMessage {
|
enum class ErrorMessage {
|
||||||
NO_EXPRESSION
|
NO_EXPRESSION,
|
||||||
NO_CONTAINER
|
NO_CONTAINER,
|
||||||
SUPER_CALL
|
SUPER_CALL,
|
||||||
DENOTABLE_TYPES
|
DENOTABLE_TYPES,
|
||||||
ERROR_TYPES
|
ERROR_TYPES,
|
||||||
MULTIPLE_OUTPUT
|
MULTIPLE_OUTPUT,
|
||||||
OUTPUT_AND_EXIT_POINT
|
OUTPUT_AND_EXIT_POINT,
|
||||||
MULTIPLE_EXIT_POINTS
|
MULTIPLE_EXIT_POINTS,
|
||||||
DECLARATIONS_ARE_USED_OUTSIDE
|
DECLARATIONS_ARE_USED_OUTSIDE,
|
||||||
DECLARATIONS_OUT_OF_SCOPE
|
DECLARATIONS_OUT_OF_SCOPE;
|
||||||
|
|
||||||
var additionalInfo: List<String>? = null
|
var additionalInfo: List<String>? = null
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -91,21 +91,21 @@ public class KotlinInplaceParameterIntroducer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class PreviewDecorator {
|
enum class PreviewDecorator {
|
||||||
FOR_ADD: PreviewDecorator() {
|
FOR_ADD() {
|
||||||
override val textAttributes: TextAttributes = with(TextAttributes()) {
|
override val textAttributes: TextAttributes = with(TextAttributes()) {
|
||||||
setEffectType(EffectType.ROUNDED_BOX)
|
setEffectType(EffectType.ROUNDED_BOX)
|
||||||
setEffectColor(JBColor.RED)
|
setEffectColor(JBColor.RED)
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
FOR_REMOVAL: PreviewDecorator() {
|
FOR_REMOVAL() {
|
||||||
override val textAttributes: TextAttributes = with(TextAttributes()) {
|
override val textAttributes: TextAttributes = with(TextAttributes()) {
|
||||||
setEffectType(EffectType.STRIKEOUT)
|
setEffectType(EffectType.STRIKEOUT)
|
||||||
setEffectColor(Color.BLACK)
|
setEffectColor(Color.BLACK)
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
protected abstract val textAttributes: TextAttributes
|
protected abstract val textAttributes: TextAttributes
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -91,8 +91,8 @@ public class RenameKotlinPropertyProcessor : RenamePsiElementProcessor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private enum class UsageKind {
|
private enum class UsageKind {
|
||||||
SIMPLE_PROPERTY_USAGE
|
SIMPLE_PROPERTY_USAGE,
|
||||||
GETTER_USAGE
|
GETTER_USAGE,
|
||||||
SETTER_USAGE
|
SETTER_USAGE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,11 +94,11 @@ public trait UnificationResult {
|
|||||||
public enum class Status {
|
public enum class Status {
|
||||||
MATCHED {
|
MATCHED {
|
||||||
override fun and(other: Status): Status = other
|
override fun and(other: Status): Status = other
|
||||||
}
|
},
|
||||||
|
|
||||||
UNMATCHED {
|
UNMATCHED {
|
||||||
override fun and(other: Status): Status = this
|
override fun and(other: Status): Status = this
|
||||||
}
|
};
|
||||||
|
|
||||||
public abstract fun and(other: Status): Status
|
public abstract fun and(other: Status): Status
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ enum class MoveAction {
|
|||||||
|
|
||||||
MoveMembersProcessor(elementAtCaret.getProject(), options).run()
|
MoveMembersProcessor(elementAtCaret.getProject(), options).run()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
MOVE_TOP_LEVEL_CLASSES {
|
MOVE_TOP_LEVEL_CLASSES {
|
||||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||||
@@ -152,7 +152,7 @@ enum class MoveAction {
|
|||||||
/* moveCallback = */ null
|
/* moveCallback = */ null
|
||||||
).run()
|
).run()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
MOVE_PACKAGES {
|
MOVE_PACKAGES {
|
||||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||||
@@ -169,7 +169,7 @@ enum class MoveAction {
|
|||||||
/* moveCallback = */ null
|
/* moveCallback = */ null
|
||||||
).run()
|
).run()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
MOVE_TOP_LEVEL_CLASSES_TO_INNER {
|
MOVE_TOP_LEVEL_CLASSES_TO_INNER {
|
||||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||||
@@ -187,7 +187,7 @@ enum class MoveAction {
|
|||||||
/* moveCallback = */ null
|
/* moveCallback = */ null
|
||||||
).run()
|
).run()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
MOVE_INNER_CLASS {
|
MOVE_INNER_CLASS {
|
||||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||||
@@ -207,7 +207,7 @@ enum class MoveAction {
|
|||||||
JavaPsiFacade.getInstance(project).findPackage(targetPackage)!!.getDirectories()[0]
|
JavaPsiFacade.getInstance(project).findPackage(targetPackage)!!.getDirectories()[0]
|
||||||
).run()
|
).run()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
MOVE_FILES {
|
MOVE_FILES {
|
||||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||||
@@ -238,7 +238,7 @@ enum class MoveAction {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS {
|
MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS {
|
||||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||||
@@ -254,13 +254,13 @@ enum class MoveAction {
|
|||||||
val options = MoveKotlinTopLevelDeclarationsOptions(listOf(elementToMove), moveTarget)
|
val options = MoveKotlinTopLevelDeclarationsOptions(listOf(elementToMove), moveTarget)
|
||||||
MoveKotlinTopLevelDeclarationsProcessor(mainFile.getProject(), options).run()
|
MoveKotlinTopLevelDeclarationsProcessor(mainFile.getProject(), options).run()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
CHANGE_PACKAGE_DIRECTIVE {
|
CHANGE_PACKAGE_DIRECTIVE {
|
||||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||||
KotlinChangePackageRefactoring(mainFile as JetFile).run(FqName(config.getString("newPackageName")))
|
KotlinChangePackageRefactoring(mainFile as JetFile).run(FqName(config.getString("newPackageName")))
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject)
|
abstract fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,11 +51,11 @@ import org.junit.Assert
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
private enum class RenameType {
|
private enum class RenameType {
|
||||||
JAVA_CLASS
|
JAVA_CLASS,
|
||||||
JAVA_METHOD
|
JAVA_METHOD,
|
||||||
KOTLIN_CLASS
|
KOTLIN_CLASS,
|
||||||
KOTLIN_FUNCTION
|
KOTLIN_FUNCTION,
|
||||||
KOTLIN_PROPERTY
|
KOTLIN_PROPERTY,
|
||||||
KOTLIN_PACKAGE
|
KOTLIN_PACKAGE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class FieldCorrectionInfo(val name: String, val access: Modifier?, val setterAcc
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class AccessorKind {
|
enum class AccessorKind {
|
||||||
GETTER
|
GETTER,
|
||||||
SETTER
|
SETTER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ object DocCommentConverter {
|
|||||||
getValueElement() ?: getDataElements().firstOrNull { it !is PsiWhiteSpace }
|
getValueElement() ?: getDataElements().firstOrNull { it !is PsiWhiteSpace }
|
||||||
|
|
||||||
private class HtmlToMarkdownConverter() : XmlRecursiveElementVisitor() {
|
private class HtmlToMarkdownConverter() : XmlRecursiveElementVisitor() {
|
||||||
private enum class ListType { Ordered Unordered; }
|
private enum class ListType { Ordered, Unordered; }
|
||||||
data class MarkdownSpan(val prefix: String, val suffix: String) {
|
data class MarkdownSpan(val prefix: String, val suffix: String) {
|
||||||
companion object {
|
companion object {
|
||||||
val Empty = MarkdownSpan("", "")
|
val Empty = MarkdownSpan("", "")
|
||||||
|
|||||||
@@ -121,8 +121,8 @@ class ForConverter(
|
|||||||
) : Statement() {
|
) : Statement() {
|
||||||
|
|
||||||
public enum class Kind {
|
public enum class Kind {
|
||||||
SIMPLE
|
SIMPLE,
|
||||||
WITH_BLOCK
|
WITH_BLOCK,
|
||||||
WITH_RUN_BLOCK
|
WITH_RUN_BLOCK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public trait PostProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum class ParseContext {
|
public enum class ParseContext {
|
||||||
TOP_LEVEL
|
TOP_LEVEL,
|
||||||
CODE_BLOCK
|
CODE_BLOCK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import com.intellij.psi.PsiSuperExpression
|
|||||||
import org.jetbrains.kotlin.j2k.ast.*
|
import org.jetbrains.kotlin.j2k.ast.*
|
||||||
|
|
||||||
enum class SpecialMethod(val qualifiedClassName: String?, val methodName: String, val parameterCount: Int?) {
|
enum class SpecialMethod(val qualifiedClassName: String?, val methodName: String, val parameterCount: Int?) {
|
||||||
OBJECT_EQUALS: SpecialMethod(null, "equals", 1) {
|
OBJECT_EQUALS(null, "equals", 1) {
|
||||||
override fun matches(method: PsiMethod)
|
override fun matches(method: PsiMethod)
|
||||||
= super.matches(method) && method.getParameterList().getParameters().single().getType().getCanonicalText() == JAVA_LANG_OBJECT
|
= super.matches(method) && method.getParameterList().getParameters().single().getType().getCanonicalText() == JAVA_LANG_OBJECT
|
||||||
|
|
||||||
@@ -32,54 +32,54 @@ enum class SpecialMethod(val qualifiedClassName: String?, val methodName: String
|
|||||||
if (qualifier == null || qualifier is PsiSuperExpression) return null
|
if (qualifier == null || qualifier is PsiSuperExpression) return null
|
||||||
return BinaryExpression(codeConverter.convertExpression(qualifier), codeConverter.convertExpression(arguments.single()), "==")
|
return BinaryExpression(codeConverter.convertExpression(qualifier), codeConverter.convertExpression(arguments.single()), "==")
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
OBJECT_GET_CLASS: SpecialMethod("java.lang.Object", "getClass", 0) {
|
OBJECT_GET_CLASS("java.lang.Object", "getClass", 0) {
|
||||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter): Expression {
|
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter): Expression {
|
||||||
val identifier = Identifier("javaClass", false).assignNoPrototype()
|
val identifier = Identifier("javaClass", false).assignNoPrototype()
|
||||||
return if (qualifier != null) QualifiedExpression(codeConverter.convertExpression(qualifier), identifier) else identifier
|
return if (qualifier != null) QualifiedExpression(codeConverter.convertExpression(qualifier), identifier) else identifier
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
OBJECTS_EQUALS: SpecialMethod("java.util.Objects", "equals", 2) {
|
OBJECTS_EQUALS("java.util.Objects", "equals", 2) {
|
||||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||||
= BinaryExpression(codeConverter.convertExpression(arguments[0]), codeConverter.convertExpression(arguments[1]), "==")
|
= BinaryExpression(codeConverter.convertExpression(arguments[0]), codeConverter.convertExpression(arguments[1]), "==")
|
||||||
}
|
},
|
||||||
|
|
||||||
COLLECTIONS_EMPTY_LIST: SpecialMethod("java.util.Collections", "emptyList", 0) {
|
COLLECTIONS_EMPTY_LIST("java.util.Collections", "emptyList", 0) {
|
||||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||||
= MethodCallExpression.build(null, "emptyList", listOf(), typeArgumentsConverted, false)
|
= MethodCallExpression.build(null, "emptyList", listOf(), typeArgumentsConverted, false)
|
||||||
}
|
},
|
||||||
|
|
||||||
COLLECTIONS_EMPTY_SET: SpecialMethod("java.util.Collections", "emptySet", 0) {
|
COLLECTIONS_EMPTY_SET("java.util.Collections", "emptySet", 0) {
|
||||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||||
= MethodCallExpression.build(null, "emptySet", listOf(), typeArgumentsConverted, false)
|
= MethodCallExpression.build(null, "emptySet", listOf(), typeArgumentsConverted, false)
|
||||||
}
|
},
|
||||||
|
|
||||||
COLLECTIONS_EMPTY_MAP: SpecialMethod("java.util.Collections", "emptyMap", 0) {
|
COLLECTIONS_EMPTY_MAP("java.util.Collections", "emptyMap", 0) {
|
||||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||||
= MethodCallExpression.build(null, "emptyMap", listOf(), typeArgumentsConverted, false)
|
= MethodCallExpression.build(null, "emptyMap", listOf(), typeArgumentsConverted, false)
|
||||||
}
|
},
|
||||||
|
|
||||||
COLLECTIONS_SINGLETON_LIST: SpecialMethod("java.util.Collections", "singletonList", 1) {
|
COLLECTIONS_SINGLETON_LIST("java.util.Collections", "singletonList", 1) {
|
||||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||||
= MethodCallExpression.build(null, "listOf", listOf(codeConverter.convertExpression(arguments.single())), typeArgumentsConverted, false)
|
= MethodCallExpression.build(null, "listOf", listOf(codeConverter.convertExpression(arguments.single())), typeArgumentsConverted, false)
|
||||||
}
|
},
|
||||||
|
|
||||||
COLLECTIONS_SINGLETON: SpecialMethod("java.util.Collections", "singleton", 1) {
|
COLLECTIONS_SINGLETON("java.util.Collections", "singleton", 1) {
|
||||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||||
= MethodCallExpression.build(null, "setOf", listOf(codeConverter.convertExpression(arguments.single())), typeArgumentsConverted, false)
|
= MethodCallExpression.build(null, "setOf", listOf(codeConverter.convertExpression(arguments.single())), typeArgumentsConverted, false)
|
||||||
}
|
},
|
||||||
|
|
||||||
SYSTEM_OUT_PRINTLN: SpecialMethod("java.io.PrintStream", "println", null) {
|
SYSTEM_OUT_PRINTLN("java.io.PrintStream", "println", null) {
|
||||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||||
= convertSystemOutMethodCall(methodName, qualifier, arguments, typeArgumentsConverted, codeConverter)
|
= convertSystemOutMethodCall(methodName, qualifier, arguments, typeArgumentsConverted, codeConverter)
|
||||||
}
|
},
|
||||||
|
|
||||||
SYSTEM_OUT_PRINT: SpecialMethod("java.io.PrintStream", "print", null) {
|
SYSTEM_OUT_PRINT("java.io.PrintStream", "print", null) {
|
||||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||||
= convertSystemOutMethodCall(methodName, qualifier, arguments, typeArgumentsConverted, codeConverter)
|
= convertSystemOutMethodCall(methodName, qualifier, arguments, typeArgumentsConverted, codeConverter)
|
||||||
}
|
};
|
||||||
|
|
||||||
open fun matches(method: PsiMethod): Boolean {
|
open fun matches(method: PsiMethod): Boolean {
|
||||||
if (method.getName() != methodName) return false
|
if (method.getName() != methodName) return false
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ import org.jetbrains.kotlin.j2k.*
|
|||||||
import java.util.HashSet
|
import java.util.HashSet
|
||||||
|
|
||||||
enum class Modifier(val name: String) {
|
enum class Modifier(val name: String) {
|
||||||
PUBLIC: Modifier("public")
|
PUBLIC("public"),
|
||||||
PROTECTED: Modifier("protected")
|
PROTECTED("protected"),
|
||||||
PRIVATE: Modifier("private")
|
PRIVATE("private"),
|
||||||
ABSTRACT: Modifier("abstract")
|
ABSTRACT("abstract"),
|
||||||
OPEN: Modifier("open")
|
OPEN("open"),
|
||||||
OVERRIDE: Modifier("override")
|
OVERRIDE("override"),
|
||||||
INNER: Modifier("inner")
|
INNER("inner");
|
||||||
|
|
||||||
public fun toKotlin(): String = name
|
public fun toKotlin(): String = name
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ class Parameter(val identifier: Identifier,
|
|||||||
val modifiers: Modifiers,
|
val modifiers: Modifiers,
|
||||||
val defaultValue: DeferredElement<Expression>? = null) : Element() {
|
val defaultValue: DeferredElement<Expression>? = null) : Element() {
|
||||||
public enum class VarValModifier {
|
public enum class VarValModifier {
|
||||||
None
|
None,
|
||||||
Val
|
Val,
|
||||||
Var
|
Var
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import org.jetbrains.kotlin.j2k.*
|
|||||||
fun Type.isUnit(): Boolean = this is UnitType
|
fun Type.isUnit(): Boolean = this is UnitType
|
||||||
|
|
||||||
enum class Nullability {
|
enum class Nullability {
|
||||||
Nullable
|
Nullable,
|
||||||
NotNull
|
NotNull,
|
||||||
Default
|
Default
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,8 +33,8 @@ fun Nullability.isNullable(settings: ConverterSettings) = when(this) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class Mutability {
|
enum class Mutability {
|
||||||
Mutable
|
Mutable,
|
||||||
NonMutable
|
NonMutable,
|
||||||
Default
|
Default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ public class IncrementalCacheImpl(targetDataRoot: File) : StorageOwner, Incremen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private enum class Kind {
|
private enum class Kind {
|
||||||
INT FLOAT LONG DOUBLE STRING
|
INT, FLOAT, LONG, DOUBLE, STRING
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -588,10 +588,10 @@ public class IncrementalCacheImpl(targetDataRoot: File) : StorageOwner, Incremen
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class RecompilationDecision {
|
enum class RecompilationDecision {
|
||||||
DO_NOTHING
|
DO_NOTHING,
|
||||||
RECOMPILE_OTHER_KOTLIN_IN_CHUNK
|
RECOMPILE_OTHER_KOTLIN_IN_CHUNK,
|
||||||
RECOMPILE_OTHER_IN_CHUNK_AND_DEPENDANTS
|
RECOMPILE_OTHER_IN_CHUNK_AND_DEPENDANTS,
|
||||||
RECOMPILE_ALL_IN_CHUNK_AND_DEPENDANTS
|
RECOMPILE_ALL_IN_CHUNK_AND_DEPENDANTS;
|
||||||
|
|
||||||
fun merge(other: RecompilationDecision): RecompilationDecision {
|
fun merge(other: RecompilationDecision): RecompilationDecision {
|
||||||
return if (other.ordinal() > this.ordinal()) other else this
|
return if (other.ordinal() > this.ordinal()) other else this
|
||||||
|
|||||||
+1
-1
@@ -37,6 +37,6 @@ public var JsParameter.hasDefaultValue: Boolean by MetadataProperty(default = fa
|
|||||||
public var JsInvocation.typeCheck: TypeCheck? by MetadataProperty(default = null)
|
public var JsInvocation.typeCheck: TypeCheck? by MetadataProperty(default = null)
|
||||||
|
|
||||||
public enum class TypeCheck {
|
public enum class TypeCheck {
|
||||||
TYPEOF
|
TYPEOF,
|
||||||
INSTANCEOF
|
INSTANCEOF
|
||||||
}
|
}
|
||||||
@@ -20,11 +20,11 @@ import kotlin.properties.Delegates
|
|||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
|
|
||||||
public enum class PredefinedAnnotation(fqName: String) {
|
public enum class PredefinedAnnotation(fqName: String) {
|
||||||
LIBRARY : PredefinedAnnotation("kotlin.js.library")
|
LIBRARY("kotlin.js.library"),
|
||||||
NATIVE : PredefinedAnnotation("kotlin.js.native")
|
NATIVE("kotlin.js.native"),
|
||||||
NATIVE_INVOKE : PredefinedAnnotation("kotlin.js.nativeInvoke")
|
NATIVE_INVOKE("kotlin.js.nativeInvoke"),
|
||||||
NATIVE_GETTER : PredefinedAnnotation("kotlin.js.nativeGetter")
|
NATIVE_GETTER("kotlin.js.nativeGetter"),
|
||||||
NATIVE_SETTER : PredefinedAnnotation("kotlin.js.nativeSetter")
|
NATIVE_SETTER("kotlin.js.nativeSetter");
|
||||||
|
|
||||||
public val fqName: FqName = FqName(fqName)
|
public val fqName: FqName = FqName(fqName)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -55,7 +55,7 @@ public class CallArgumentTranslator private (
|
|||||||
}
|
}
|
||||||
|
|
||||||
private enum class ArgumentsKind {
|
private enum class ArgumentsKind {
|
||||||
HAS_EMPTY_EXPRESSION_ARGUMENT
|
HAS_EMPTY_EXPRESSION_ARGUMENT,
|
||||||
HAS_NOT_EMPTY_EXPRESSION_ARGUMENT
|
HAS_NOT_EMPTY_EXPRESSION_ARGUMENT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,6 @@
|
|||||||
package org.jetbrains.kotlin.js.translate.utils
|
package org.jetbrains.kotlin.js.translate.utils
|
||||||
|
|
||||||
enum class InlineAnnotation(val fqName: String) {
|
enum class InlineAnnotation(val fqName: String) {
|
||||||
INLINE : InlineAnnotation("kotlin.inline")
|
INLINE("kotlin.inline"),
|
||||||
NO_INLINE : InlineAnnotation("kotlin.noinline")
|
NO_INLINE("kotlin.noinline")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import java.util.NoSuchElementException
|
|||||||
import java.lang.UnsupportedOperationException
|
import java.lang.UnsupportedOperationException
|
||||||
|
|
||||||
private enum class State {
|
private enum class State {
|
||||||
Ready
|
Ready,
|
||||||
NotReady
|
NotReady,
|
||||||
Done
|
Done,
|
||||||
Failed
|
Failed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import java.util.Stack
|
|||||||
*/
|
*/
|
||||||
public enum class FileWalkDirection {
|
public enum class FileWalkDirection {
|
||||||
/** Depth-first search, directory is visited BEFORE its files */
|
/** Depth-first search, directory is visited BEFORE its files */
|
||||||
TOP_DOWN
|
TOP_DOWN,
|
||||||
/** Depth-first search, directory is visited AFTER its files */
|
/** Depth-first search, directory is visited AFTER its files */
|
||||||
BOTTOM_UP
|
BOTTOM_UP
|
||||||
// Do we want also breadth-first search?
|
// Do we want also breadth-first search?
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ public fun File.copyTo(dst: File, overwrite: Boolean = false, bufferSize: Int =
|
|||||||
*/
|
*/
|
||||||
public enum class OnErrorAction {
|
public enum class OnErrorAction {
|
||||||
/** Skip this file and go to the next. */
|
/** Skip this file and go to the next. */
|
||||||
SKIP
|
SKIP,
|
||||||
|
|
||||||
/** Terminate the evaluation of the function. */
|
/** Terminate the evaluation of the function. */
|
||||||
TERMINATE
|
TERMINATE
|
||||||
|
|||||||
@@ -9,152 +9,152 @@ public enum class CharCategory(public val value: Int, public val code: String) {
|
|||||||
/**
|
/**
|
||||||
* General category "Cn" in the Unicode specification.
|
* General category "Cn" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
UNASSIGNED: CharCategory(Character.UNASSIGNED.toInt(), "Cn")
|
UNASSIGNED(Character.UNASSIGNED.toInt(), "Cn"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Lu" in the Unicode specification.
|
* General category "Lu" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
UPPERCASE_LETTER: CharCategory(Character.UPPERCASE_LETTER.toInt(), "Lu")
|
UPPERCASE_LETTER(Character.UPPERCASE_LETTER.toInt(), "Lu"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Ll" in the Unicode specification.
|
* General category "Ll" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
LOWERCASE_LETTER: CharCategory(Character.LOWERCASE_LETTER.toInt(), "Ll")
|
LOWERCASE_LETTER(Character.LOWERCASE_LETTER.toInt(), "Ll"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Lt" in the Unicode specification.
|
* General category "Lt" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
TITLECASE_LETTER: CharCategory(Character.TITLECASE_LETTER.toInt(), "Lt")
|
TITLECASE_LETTER(Character.TITLECASE_LETTER.toInt(), "Lt"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Lm" in the Unicode specification.
|
* General category "Lm" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
MODIFIER_LETTER: CharCategory(Character.MODIFIER_LETTER.toInt(), "Lm")
|
MODIFIER_LETTER(Character.MODIFIER_LETTER.toInt(), "Lm"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Lo" in the Unicode specification.
|
* General category "Lo" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
OTHER_LETTER: CharCategory(Character.OTHER_LETTER.toInt(), "Lo")
|
OTHER_LETTER(Character.OTHER_LETTER.toInt(), "Lo"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Mn" in the Unicode specification.
|
* General category "Mn" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
NON_SPACING_MARK: CharCategory(Character.NON_SPACING_MARK.toInt(), "Mn")
|
NON_SPACING_MARK(Character.NON_SPACING_MARK.toInt(), "Mn"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Me" in the Unicode specification.
|
* General category "Me" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
ENCLOSING_MARK: CharCategory(Character.ENCLOSING_MARK.toInt(), "Me")
|
ENCLOSING_MARK(Character.ENCLOSING_MARK.toInt(), "Me"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Mc" in the Unicode specification.
|
* General category "Mc" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
COMBINING_SPACING_MARK: CharCategory(Character.COMBINING_SPACING_MARK.toInt(), "Mc")
|
COMBINING_SPACING_MARK(Character.COMBINING_SPACING_MARK.toInt(), "Mc"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Nd" in the Unicode specification.
|
* General category "Nd" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
DECIMAL_DIGIT_NUMBER: CharCategory(Character.DECIMAL_DIGIT_NUMBER.toInt(), "Nd")
|
DECIMAL_DIGIT_NUMBER(Character.DECIMAL_DIGIT_NUMBER.toInt(), "Nd"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Nl" in the Unicode specification.
|
* General category "Nl" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
LETTER_NUMBER: CharCategory(Character.LETTER_NUMBER.toInt(), "Nl")
|
LETTER_NUMBER(Character.LETTER_NUMBER.toInt(), "Nl"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "No" in the Unicode specification.
|
* General category "No" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
OTHER_NUMBER: CharCategory(Character.OTHER_NUMBER.toInt(), "No")
|
OTHER_NUMBER(Character.OTHER_NUMBER.toInt(), "No"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Zs" in the Unicode specification.
|
* General category "Zs" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
SPACE_SEPARATOR: CharCategory(Character.SPACE_SEPARATOR.toInt(), "Zs")
|
SPACE_SEPARATOR(Character.SPACE_SEPARATOR.toInt(), "Zs"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Zl" in the Unicode specification.
|
* General category "Zl" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
LINE_SEPARATOR: CharCategory(Character.LINE_SEPARATOR.toInt(), "Zl")
|
LINE_SEPARATOR(Character.LINE_SEPARATOR.toInt(), "Zl"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Zp" in the Unicode specification.
|
* General category "Zp" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
PARAGRAPH_SEPARATOR: CharCategory(Character.PARAGRAPH_SEPARATOR.toInt(), "Zp")
|
PARAGRAPH_SEPARATOR(Character.PARAGRAPH_SEPARATOR.toInt(), "Zp"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Cc" in the Unicode specification.
|
* General category "Cc" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
CONTROL: CharCategory(Character.CONTROL.toInt(), "Cc")
|
CONTROL(Character.CONTROL.toInt(), "Cc"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Cf" in the Unicode specification.
|
* General category "Cf" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
FORMAT: CharCategory(Character.FORMAT.toInt(), "Cf")
|
FORMAT(Character.FORMAT.toInt(), "Cf"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Co" in the Unicode specification.
|
* General category "Co" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
PRIVATE_USE: CharCategory(Character.PRIVATE_USE.toInt(), "Co")
|
PRIVATE_USE(Character.PRIVATE_USE.toInt(), "Co"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Cs" in the Unicode specification.
|
* General category "Cs" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
SURROGATE: CharCategory(Character.SURROGATE.toInt(), "Cs")
|
SURROGATE(Character.SURROGATE.toInt(), "Cs"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Pd" in the Unicode specification.
|
* General category "Pd" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
DASH_PUNCTUATION: CharCategory(Character.DASH_PUNCTUATION.toInt(), "Pd")
|
DASH_PUNCTUATION(Character.DASH_PUNCTUATION.toInt(), "Pd"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Ps" in the Unicode specification.
|
* General category "Ps" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
START_PUNCTUATION: CharCategory(Character.START_PUNCTUATION.toInt(), "Ps")
|
START_PUNCTUATION(Character.START_PUNCTUATION.toInt(), "Ps"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Pe" in the Unicode specification.
|
* General category "Pe" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
END_PUNCTUATION: CharCategory(Character.END_PUNCTUATION.toInt(), "Pe")
|
END_PUNCTUATION(Character.END_PUNCTUATION.toInt(), "Pe"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Pc" in the Unicode specification.
|
* General category "Pc" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
CONNECTOR_PUNCTUATION: CharCategory(Character.CONNECTOR_PUNCTUATION.toInt(), "Pc")
|
CONNECTOR_PUNCTUATION(Character.CONNECTOR_PUNCTUATION.toInt(), "Pc"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Po" in the Unicode specification.
|
* General category "Po" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
OTHER_PUNCTUATION: CharCategory(Character.OTHER_PUNCTUATION.toInt(), "Po")
|
OTHER_PUNCTUATION(Character.OTHER_PUNCTUATION.toInt(), "Po"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Sm" in the Unicode specification.
|
* General category "Sm" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
MATH_SYMBOL: CharCategory(Character.MATH_SYMBOL.toInt(), "Sm")
|
MATH_SYMBOL(Character.MATH_SYMBOL.toInt(), "Sm"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Sc" in the Unicode specification.
|
* General category "Sc" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
CURRENCY_SYMBOL: CharCategory(Character.CURRENCY_SYMBOL.toInt(), "Sc")
|
CURRENCY_SYMBOL(Character.CURRENCY_SYMBOL.toInt(), "Sc"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Sk" in the Unicode specification.
|
* General category "Sk" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
MODIFIER_SYMBOL: CharCategory(Character.MODIFIER_SYMBOL.toInt(), "Sk")
|
MODIFIER_SYMBOL(Character.MODIFIER_SYMBOL.toInt(), "Sk"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "So" in the Unicode specification.
|
* General category "So" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
OTHER_SYMBOL: CharCategory(Character.OTHER_SYMBOL.toInt(), "So")
|
OTHER_SYMBOL(Character.OTHER_SYMBOL.toInt(), "So"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Pi" in the Unicode specification.
|
* General category "Pi" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
INITIAL_QUOTE_PUNCTUATION: CharCategory(Character.INITIAL_QUOTE_PUNCTUATION.toInt(), "Pi")
|
INITIAL_QUOTE_PUNCTUATION(Character.INITIAL_QUOTE_PUNCTUATION.toInt(), "Pi"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General category "Pf" in the Unicode specification.
|
* General category "Pf" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
FINAL_QUOTE_PUNCTUATION: CharCategory(Character.FINAL_QUOTE_PUNCTUATION.toInt(), "Pf")
|
FINAL_QUOTE_PUNCTUATION(Character.FINAL_QUOTE_PUNCTUATION.toInt(), "Pf");
|
||||||
|
|
||||||
|
|
||||||
public companion object {
|
public companion object {
|
||||||
|
|||||||
@@ -13,102 +13,102 @@ public enum class CharDirectionality(public val value: Int) {
|
|||||||
* Undefined bidirectional character type. Undefined `char`
|
* Undefined bidirectional character type. Undefined `char`
|
||||||
* values have undefined directionality in the Unicode specification.
|
* values have undefined directionality in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
UNDEFINED: CharDirectionality(Character.DIRECTIONALITY_UNDEFINED.toInt())
|
UNDEFINED(Character.DIRECTIONALITY_UNDEFINED.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strong bidirectional character type "L" in the Unicode specification.
|
* Strong bidirectional character type "L" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
LEFT_TO_RIGHT: CharDirectionality(Character.DIRECTIONALITY_LEFT_TO_RIGHT.toInt())
|
LEFT_TO_RIGHT(Character.DIRECTIONALITY_LEFT_TO_RIGHT.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strong bidirectional character type "R" in the Unicode specification.
|
* Strong bidirectional character type "R" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
RIGHT_TO_LEFT: CharDirectionality(Character.DIRECTIONALITY_RIGHT_TO_LEFT.toInt())
|
RIGHT_TO_LEFT(Character.DIRECTIONALITY_RIGHT_TO_LEFT.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strong bidirectional character type "AL" in the Unicode specification.
|
* Strong bidirectional character type "AL" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
RIGHT_TO_LEFT_ARABIC: CharDirectionality(Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC.toInt())
|
RIGHT_TO_LEFT_ARABIC(Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weak bidirectional character type "EN" in the Unicode specification.
|
* Weak bidirectional character type "EN" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
EUROPEAN_NUMBER: CharDirectionality(Character.DIRECTIONALITY_EUROPEAN_NUMBER.toInt())
|
EUROPEAN_NUMBER(Character.DIRECTIONALITY_EUROPEAN_NUMBER.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weak bidirectional character type "ES" in the Unicode specification.
|
* Weak bidirectional character type "ES" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
EUROPEAN_NUMBER_SEPARATOR: CharDirectionality(Character.DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR.toInt())
|
EUROPEAN_NUMBER_SEPARATOR(Character.DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weak bidirectional character type "ET" in the Unicode specification.
|
* Weak bidirectional character type "ET" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
EUROPEAN_NUMBER_TERMINATOR: CharDirectionality(Character.DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR.toInt())
|
EUROPEAN_NUMBER_TERMINATOR(Character.DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weak bidirectional character type "AN" in the Unicode specification.
|
* Weak bidirectional character type "AN" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
ARABIC_NUMBER: CharDirectionality(Character.DIRECTIONALITY_ARABIC_NUMBER.toInt())
|
ARABIC_NUMBER(Character.DIRECTIONALITY_ARABIC_NUMBER.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weak bidirectional character type "CS" in the Unicode specification.
|
* Weak bidirectional character type "CS" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
COMMON_NUMBER_SEPARATOR: CharDirectionality(Character.DIRECTIONALITY_COMMON_NUMBER_SEPARATOR.toInt())
|
COMMON_NUMBER_SEPARATOR(Character.DIRECTIONALITY_COMMON_NUMBER_SEPARATOR.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weak bidirectional character type "NSM" in the Unicode specification.
|
* Weak bidirectional character type "NSM" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
NONSPACING_MARK: CharDirectionality(Character.DIRECTIONALITY_NONSPACING_MARK.toInt())
|
NONSPACING_MARK(Character.DIRECTIONALITY_NONSPACING_MARK.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weak bidirectional character type "BN" in the Unicode specification.
|
* Weak bidirectional character type "BN" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
BOUNDARY_NEUTRAL: CharDirectionality(Character.DIRECTIONALITY_BOUNDARY_NEUTRAL.toInt())
|
BOUNDARY_NEUTRAL(Character.DIRECTIONALITY_BOUNDARY_NEUTRAL.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Neutral bidirectional character type "B" in the Unicode specification.
|
* Neutral bidirectional character type "B" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
PARAGRAPH_SEPARATOR: CharDirectionality(Character.DIRECTIONALITY_PARAGRAPH_SEPARATOR.toInt())
|
PARAGRAPH_SEPARATOR(Character.DIRECTIONALITY_PARAGRAPH_SEPARATOR.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Neutral bidirectional character type "S" in the Unicode specification.
|
* Neutral bidirectional character type "S" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
SEGMENT_SEPARATOR: CharDirectionality(Character.DIRECTIONALITY_SEGMENT_SEPARATOR.toInt())
|
SEGMENT_SEPARATOR(Character.DIRECTIONALITY_SEGMENT_SEPARATOR.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Neutral bidirectional character type "WS" in the Unicode specification.
|
* Neutral bidirectional character type "WS" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
WHITESPACE: CharDirectionality(Character.DIRECTIONALITY_WHITESPACE.toInt())
|
WHITESPACE(Character.DIRECTIONALITY_WHITESPACE.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Neutral bidirectional character type "ON" in the Unicode specification.
|
* Neutral bidirectional character type "ON" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
OTHER_NEUTRALS: CharDirectionality(Character.DIRECTIONALITY_OTHER_NEUTRALS.toInt())
|
OTHER_NEUTRALS(Character.DIRECTIONALITY_OTHER_NEUTRALS.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strong bidirectional character type "LRE" in the Unicode specification.
|
* Strong bidirectional character type "LRE" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
LEFT_TO_RIGHT_EMBEDDING: CharDirectionality(Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING.toInt())
|
LEFT_TO_RIGHT_EMBEDDING(Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strong bidirectional character type "LRO" in the Unicode specification.
|
* Strong bidirectional character type "LRO" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
LEFT_TO_RIGHT_OVERRIDE: CharDirectionality(Character.DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE.toInt())
|
LEFT_TO_RIGHT_OVERRIDE(Character.DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strong bidirectional character type "RLE" in the Unicode specification.
|
* Strong bidirectional character type "RLE" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
RIGHT_TO_LEFT_EMBEDDING: CharDirectionality(Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING.toInt())
|
RIGHT_TO_LEFT_EMBEDDING(Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strong bidirectional character type "RLO" in the Unicode specification.
|
* Strong bidirectional character type "RLO" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
RIGHT_TO_LEFT_OVERRIDE: CharDirectionality(Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE.toInt())
|
RIGHT_TO_LEFT_OVERRIDE(Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE.toInt()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weak bidirectional character type "PDF" in the Unicode specification.
|
* Weak bidirectional character type "PDF" in the Unicode specification.
|
||||||
*/
|
*/
|
||||||
POP_DIRECTIONAL_FORMAT: CharDirectionality(Character.DIRECTIONALITY_POP_DIRECTIONAL_FORMAT.toInt())
|
POP_DIRECTIONAL_FORMAT(Character.DIRECTIONALITY_POP_DIRECTIONAL_FORMAT.toInt());
|
||||||
|
|
||||||
|
|
||||||
public companion object {
|
public companion object {
|
||||||
|
|||||||
@@ -35,13 +35,13 @@ public enum class RegexOption(override val value: Int, override val mask: Int =
|
|||||||
// common
|
// common
|
||||||
|
|
||||||
/** Enables case-insensitive matching. Case comparison is Unicode-aware. */
|
/** Enables case-insensitive matching. Case comparison is Unicode-aware. */
|
||||||
IGNORE_CASE : RegexOption(Pattern.CASE_INSENSITIVE)
|
IGNORE_CASE(Pattern.CASE_INSENSITIVE),
|
||||||
|
|
||||||
/** Enables multiline mode.
|
/** Enables multiline mode.
|
||||||
*
|
*
|
||||||
* In multiline mode the expressions `^` and `$` match just after or just before,
|
* In multiline mode the expressions `^` and `$` match just after or just before,
|
||||||
* respectively, a line terminator or the end of the input sequence. */
|
* respectively, a line terminator or the end of the input sequence. */
|
||||||
MULTILINE : RegexOption(Pattern.MULTILINE)
|
MULTILINE(Pattern.MULTILINE),
|
||||||
|
|
||||||
//jvm-specific
|
//jvm-specific
|
||||||
|
|
||||||
@@ -49,27 +49,27 @@ public enum class RegexOption(override val value: Int, override val mask: Int =
|
|||||||
*
|
*
|
||||||
* Metacharacters or escape sequences in the input sequence will be given no special meaning.
|
* Metacharacters or escape sequences in the input sequence will be given no special meaning.
|
||||||
*/
|
*/
|
||||||
LITERAL : RegexOption(Pattern.LITERAL)
|
LITERAL(Pattern.LITERAL),
|
||||||
|
|
||||||
// // Unicode case is enabled by default with the IGNORE_CASE
|
// // Unicode case is enabled by default with the IGNORE_CASE
|
||||||
// /** Enables Unicode-aware case folding. */
|
// /** Enables Unicode-aware case folding. */
|
||||||
// UNICODE_CASE: RegexOption(Pattern.UNICODE_CASE)
|
// UNICODE_CASE(Pattern.UNICODE_CASE)
|
||||||
|
|
||||||
/** Enables Unix lines mode.
|
/** Enables Unix lines mode.
|
||||||
* In this mode, only the `'\n'` is recognized as a line terminator.
|
* In this mode, only the `'\n'` is recognized as a line terminator.
|
||||||
*/
|
*/
|
||||||
UNIX_LINES: RegexOption(Pattern.UNIX_LINES) // TODO: Remove this
|
UNIX_LINES(Pattern.UNIX_LINES), // TODO: Remove this
|
||||||
|
|
||||||
/** Permits whitespace and comments in pattern. */
|
/** Permits whitespace and comments in pattern. */
|
||||||
COMMENTS: RegexOption(Pattern.COMMENTS)
|
COMMENTS(Pattern.COMMENTS),
|
||||||
|
|
||||||
/** Enables the mode, when the expression `.` matches any character,
|
/** Enables the mode, when the expression `.` matches any character,
|
||||||
* including a line terminator.
|
* including a line terminator.
|
||||||
*/
|
*/
|
||||||
DOT_MATCHES_ALL: RegexOption(Pattern.DOTALL)
|
DOT_MATCHES_ALL(Pattern.DOTALL),
|
||||||
|
|
||||||
/** Enables equivalence by canonical decomposition. */
|
/** Enables equivalence by canonical decomposition. */
|
||||||
CANON_EQ: RegexOption(Pattern.CANON_EQ)
|
CANON_EQ(Pattern.CANON_EQ)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ data class Constant(val name: String, val type: String, val value: String?)
|
|||||||
fun Attribute.formatFunctionTypePart() = if (vararg) "vararg $type" else type
|
fun Attribute.formatFunctionTypePart() = if (vararg) "vararg $type" else type
|
||||||
|
|
||||||
enum class DefinitionKind {
|
enum class DefinitionKind {
|
||||||
INTERFACE
|
INTERFACE,
|
||||||
TYPEDEF
|
TYPEDEF,
|
||||||
EXTENSION_INTERFACE
|
EXTENSION_INTERFACE,
|
||||||
ENUM
|
ENUM,
|
||||||
DICTIONARY
|
DICTIONARY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ val GenerateAttribute.signature: String
|
|||||||
fun GenerateAttribute.dynamicIfUnknownType(allTypes : Set<String>, standardTypes : Set<String> = standardTypes()) = copy(type = type.dynamicIfUnknownType(allTypes, standardTypes))
|
fun GenerateAttribute.dynamicIfUnknownType(allTypes : Set<String>, standardTypes : Set<String> = standardTypes()) = copy(type = type.dynamicIfUnknownType(allTypes, standardTypes))
|
||||||
|
|
||||||
enum class NativeGetterOrSetter {
|
enum class NativeGetterOrSetter {
|
||||||
NONE
|
NONE,
|
||||||
GETTER
|
GETTER,
|
||||||
SETTER
|
SETTER
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class GenerateDefinitionKind {
|
enum class GenerateDefinitionKind {
|
||||||
TRAIT
|
TRAIT,
|
||||||
CLASS
|
CLASS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,31 +7,31 @@ import java.util.*
|
|||||||
import kotlin.properties.Delegates
|
import kotlin.properties.Delegates
|
||||||
|
|
||||||
enum class Family {
|
enum class Family {
|
||||||
Sequences
|
Sequences,
|
||||||
Iterables
|
Iterables,
|
||||||
Collections
|
Collections,
|
||||||
Lists
|
Lists,
|
||||||
Maps
|
Maps,
|
||||||
ArraysOfObjects
|
ArraysOfObjects,
|
||||||
ArraysOfPrimitives
|
ArraysOfPrimitives,
|
||||||
Strings
|
Strings,
|
||||||
RangesOfPrimitives
|
RangesOfPrimitives,
|
||||||
ProgressionsOfPrimitives
|
ProgressionsOfPrimitives,
|
||||||
Primitives
|
Primitives,
|
||||||
Generic
|
Generic;
|
||||||
|
|
||||||
val isPrimitiveSpecialization: Boolean by Delegates.lazy { this in listOf(ArraysOfPrimitives, RangesOfPrimitives, ProgressionsOfPrimitives, Primitives) }
|
val isPrimitiveSpecialization: Boolean by Delegates.lazy { this in listOf(ArraysOfPrimitives, RangesOfPrimitives, ProgressionsOfPrimitives, Primitives) }
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class PrimitiveType(val name: String) {
|
enum class PrimitiveType(val name: String) {
|
||||||
Boolean : PrimitiveType("Boolean")
|
Boolean("Boolean"),
|
||||||
Byte : PrimitiveType("Byte")
|
Byte("Byte"),
|
||||||
Char : PrimitiveType("Char")
|
Char("Char"),
|
||||||
Short : PrimitiveType("Short")
|
Short("Short"),
|
||||||
Int : PrimitiveType("Int")
|
Int("Int"),
|
||||||
Long : PrimitiveType("Long")
|
Long("Long"),
|
||||||
Float : PrimitiveType("Float")
|
Float("Float"),
|
||||||
Double : PrimitiveType("Double")
|
Double("Double")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -45,12 +45,12 @@ import org.jetbrains.org.objectweb.asm.Type
|
|||||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
||||||
|
|
||||||
private enum class AndroidClassType(val internalClassName: String, val supportsCache: Boolean = false) {
|
private enum class AndroidClassType(val internalClassName: String, val supportsCache: Boolean = false) {
|
||||||
ACTIVITY : AndroidClassType(AndroidConst.ACTIVITY_FQNAME.innerName, true)
|
ACTIVITY(AndroidConst.ACTIVITY_FQNAME.innerName, true),
|
||||||
FRAGMENT : AndroidClassType(AndroidConst.FRAGMENT_FQNAME.innerName, true)
|
FRAGMENT(AndroidConst.FRAGMENT_FQNAME.innerName, true),
|
||||||
SUPPORT_FRAGMENT_ACTIVITY : AndroidClassType(AndroidConst.SUPPORT_FRAGMENT_ACTIVITY_FQNAME.innerName, true)
|
SUPPORT_FRAGMENT_ACTIVITY(AndroidConst.SUPPORT_FRAGMENT_ACTIVITY_FQNAME.innerName, true),
|
||||||
SUPPORT_FRAGMENT : AndroidClassType(AndroidConst.SUPPORT_FRAGMENT_FQNAME.innerName, true)
|
SUPPORT_FRAGMENT(AndroidConst.SUPPORT_FRAGMENT_FQNAME.innerName, true),
|
||||||
VIEW : AndroidClassType(AndroidConst.VIEW_FQNAME.innerName)
|
VIEW(AndroidConst.VIEW_FQNAME.innerName),
|
||||||
UNKNOWN : AndroidClassType("")
|
UNKNOWN("")
|
||||||
}
|
}
|
||||||
|
|
||||||
private val String.innerName: String
|
private val String.innerName: String
|
||||||
|
|||||||
Reference in New Issue
Block a user