Remove @author JavaDoc from all my files
This commit is contained in:
committed by
Yan Zhulanow
parent
55055ce3aa
commit
57ac7e0fb9
-3
@@ -17,9 +17,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.collection
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.collections.FilterCallHandler
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.interpret.FilterTraceInterpreter
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinCollectionLibrarySupport : LibrarySupportBase() {
|
||||
init {
|
||||
addOperation(FilterOperation("filter", FilterCallHandler(), true))
|
||||
|
||||
-3
@@ -13,9 +13,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinCollectionsPe
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinStatementFactory
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinCollectionSupportProvider : LibrarySupportProvider {
|
||||
private companion object {
|
||||
val builder: StreamChainBuilder = KotlinCollectionChainBuilder()
|
||||
|
||||
-3
@@ -17,9 +17,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.JavaPeekCallFactory
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinStatementFactory
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class JavaStandardLibrarySupportProvider : LibrarySupportProvider {
|
||||
private companion object {
|
||||
val builder = TerminatedChainBuilder(
|
||||
|
||||
-3
@@ -17,9 +17,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.JavaPeekCallFactory
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinStatementFactory
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class StreamExLibrarySupportProvider : LibrarySupportProvider {
|
||||
private companion object {
|
||||
val streamChainBuilder = TerminatedChainBuilder(
|
||||
|
||||
-3
@@ -16,9 +16,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinCollectionsPe
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinStatementFactory
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinSequenceSupportProvider : LibrarySupportProvider {
|
||||
override fun getLanguageId(): String = KotlinLanguage.INSTANCE.id
|
||||
|
||||
|
||||
-3
@@ -13,9 +13,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.resolve.WindowedResolver
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.sequence.FilterIsInstanceHandler
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.sequence.KotlinDistinctByHandler
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinSequencesSupport : LibrarySupportBase() {
|
||||
init {
|
||||
addIntermediateOperationsSupport(
|
||||
|
||||
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.trace.impl.handler.type.GenericType
|
||||
import org.jetbrains.kotlin.psi.KtCallExpression
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
interface CallTypeExtractor {
|
||||
fun extractIntermediateCallTypes(call: KtCallExpression): IntermediateCallTypes
|
||||
fun extractTerminalCallTypes(call: KtCallExpression): TerminatorCallTypes
|
||||
|
||||
@@ -13,10 +13,6 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||
import org.jetbrains.kotlin.types.FlexibleType
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
|
||||
object KotlinPsiUtil {
|
||||
private val WITH_TYPES_RENDERER = DescriptorRenderer.FQ_NAMES_IN_TYPES
|
||||
|
||||
|
||||
@@ -3,9 +3,6 @@ package org.jetbrains.kotlin.idea.debugger.sequence.psi
|
||||
|
||||
import org.jetbrains.kotlin.psi.KtCallExpression
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
interface StreamCallChecker {
|
||||
fun isIntermediateCall(expression: KtCallExpression): Boolean
|
||||
fun isTerminationCall(expression: KtCallExpression): Boolean
|
||||
|
||||
-3
@@ -12,9 +12,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.psi.resolveType
|
||||
import org.jetbrains.kotlin.psi.KtCallExpression
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class CollectionChainTransformer : ChainTransformer<KtCallExpression> {
|
||||
private val transformer = KotlinChainTransformerImpl(KotlinCollectionsTypeExtractor())
|
||||
|
||||
|
||||
-3
@@ -9,9 +9,6 @@ import org.jetbrains.kotlin.psi.KtCallExpression
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinCollectionChainBuilder
|
||||
: KotlinChainBuilderBase(CollectionChainTransformer()) {
|
||||
private companion object {
|
||||
|
||||
-3
@@ -11,9 +11,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes.NULLABL
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinCollectionsTypeExtractor : CallTypeExtractor.Base() {
|
||||
private companion object {
|
||||
val LOG = Logger.getInstance(KotlinCollectionsTypeExtractor::class.java)
|
||||
|
||||
-3
@@ -9,9 +9,6 @@ import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiWhiteSpace
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
abstract class KotlinChainBuilderBase(private val transformer: ChainTransformer<KtCallExpression>) : StreamChainBuilder {
|
||||
protected abstract val existenceChecker: ExistenceChecker
|
||||
|
||||
|
||||
-3
@@ -21,9 +21,6 @@ import org.jetbrains.kotlin.psi.KtValueArgument
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getParameterForArgument
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinChainTransformerImpl(private val typeExtractor: CallTypeExtractor) : ChainTransformer<KtCallExpression> {
|
||||
override fun transform(callChain: List<KtCallExpression>, context: PsiElement): StreamChain {
|
||||
val intermediateCalls = mutableListOf<IntermediateStreamCall>()
|
||||
|
||||
-3
@@ -9,9 +9,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.psi.resolveType
|
||||
import org.jetbrains.kotlin.psi.KtCallExpression
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class PackageBasedCallChecker(private val supportedPackage: String) : StreamCallChecker {
|
||||
override fun isIntermediateCall(expression: KtCallExpression): Boolean {
|
||||
return checkReceiverSupported(expression) && checkResultSupported(expression, true)
|
||||
|
||||
-3
@@ -7,9 +7,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.psi.previousCall
|
||||
import org.jetbrains.kotlin.psi.KtCallExpression
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
open class TerminatedChainBuilder(
|
||||
transformer: ChainTransformer<KtCallExpression>,
|
||||
private val callChecker: StreamCallChecker
|
||||
|
||||
-3
@@ -10,9 +10,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.getImmediateSuperclassNotAny
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class JavaStreamChainTypeExtractor : CallTypeExtractor.Base() {
|
||||
override fun extractItemsType(type: KotlinType?): GenericType {
|
||||
if (type == null) {
|
||||
|
||||
-3
@@ -9,9 +9,6 @@ import org.jetbrains.kotlin.psi.KtCallExpression
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class SequenceCallChecker : StreamCallChecker {
|
||||
override fun isIntermediateCall(expression: KtCallExpression): Boolean {
|
||||
val receiverType = expression.receiverType() ?: return false
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.debugger.sequence.psi.sequence
|
||||
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.psi.StreamCallChecker
|
||||
import org.jetbrains.kotlin.psi.KtCallExpression
|
||||
|
||||
class SequenceCallCheckerByName(private val nestedChecker: StreamCallChecker) : StreamCallChecker {
|
||||
private companion object {
|
||||
val TERMINATION_CALLS: Set<String> = setOf(
|
||||
"all", "any", "associate", "associateBy", "associateByTo", "associateTo", "average", "chunked", "contains", "count", "distinct",
|
||||
"distinctBy", "elementAt", "elementAtOrElse", "elementAtOrNull", "find", "findLast", "first", "firstOrNull", "fold",
|
||||
"foldIndexed", "forEach", "forEachIndexed", "groupBy", "groupByTo", "indexOf", "indexOfFirst", "indexOfLast", "joinToString",
|
||||
"joinTo", "last", "lastIndexOf", "lastOrNull", "max", "maxBy", "maxWith", "min", "minBy", "minWith", "none", "partition",
|
||||
"reduce", "reduceIndexed", "single", "singleOrNull", "sum", "sumBy", "sumByDouble", "toCollection", "toHashSet", "toList",
|
||||
"toMutableList", "toMutableSet", "toSet", "toSortedSet", "unzip"
|
||||
)
|
||||
}
|
||||
|
||||
override fun isIntermediateCall(expression: KtCallExpression): Boolean {
|
||||
return nestedChecker.isIntermediateCall(expression)
|
||||
}
|
||||
|
||||
override fun isTerminationCall(expression: KtCallExpression): Boolean {
|
||||
return TERMINATION_CALLS.contains(expression.name) && nestedChecker.isTerminationCall(expression)
|
||||
}
|
||||
}
|
||||
-3
@@ -10,9 +10,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class SequenceTypeExtractor : CallTypeExtractor.Base() {
|
||||
private companion object {
|
||||
val LOG = Logger.getInstance(SequenceTypeExtractor::class.java)
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.resolve.ValuesOrderResolver
|
||||
import com.intellij.debugger.streams.trace.TraceElement
|
||||
import com.intellij.debugger.streams.trace.TraceInfo
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class ChunkedResolver : ValuesOrderResolver {
|
||||
override fun resolve(info: TraceInfo): ValuesOrderResolver.Result {
|
||||
val beforeIndex = info.valuesOrderBefore
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.resolve.ValuesOrderResolver
|
||||
import com.intellij.debugger.streams.trace.TraceElement
|
||||
import com.intellij.debugger.streams.trace.TraceInfo
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class FilteredMapResolver : ValuesOrderResolver {
|
||||
override fun resolve(info: TraceInfo): ValuesOrderResolver.Result {
|
||||
val before = info.valuesOrderBefore
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.resolve.ValuesOrderResolver
|
||||
import com.intellij.debugger.streams.trace.TraceElement
|
||||
import com.intellij.debugger.streams.trace.TraceInfo
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class WindowedResolver : ValuesOrderResolver {
|
||||
override fun resolve(info: TraceInfo): ValuesOrderResolver.Result {
|
||||
val indexBefore = info.valuesOrderBefore
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.trace.impl.handler.PeekCall
|
||||
import com.intellij.debugger.streams.trace.impl.handler.type.GenericType
|
||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class JavaPeekCallFactory : PeekCallFactory {
|
||||
override fun createPeekCall(elementsType: GenericType, lambda: String): IntermediateStreamCall =
|
||||
PeekCall(lambda, elementsType)
|
||||
|
||||
-3
@@ -8,9 +8,6 @@ import com.intellij.debugger.streams.trace.dsl.impl.TextExpression
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.VariableImpl
|
||||
import com.intellij.debugger.streams.trace.impl.handler.type.ArrayType
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinArrayVariable(override val type: ArrayType, override val name: String) : VariableImpl(type, name), ArrayVariable {
|
||||
override fun get(index: Expression): Expression = TextExpression("$name[${index.toCode()}]!!")
|
||||
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.trace.dsl.Expression
|
||||
import com.intellij.debugger.streams.trace.dsl.Variable
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.AssignmentStatement
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinAssignmentStatement(override val variable: Variable, override val expression: Expression) : AssignmentStatement {
|
||||
override fun toCode(indent: Int): String = "${variable.toCode()} = ${expression.toCode()}".withIndent(indent)
|
||||
}
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.trace.dsl.Expression
|
||||
import com.intellij.debugger.streams.trace.dsl.StatementFactory
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.LineSeparatedCodeBlock
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
open class KotlinCodeBlock(statementFactory: StatementFactory) : LineSeparatedCodeBlock(statementFactory) {
|
||||
override fun doReturn(expression: Expression) = addStatement(expression)
|
||||
}
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.trace.impl.handler.type.GenericType
|
||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.OnEachCall
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinCollectionsPeekCallFactory : PeekCallFactory {
|
||||
override fun createPeekCall(elementsType: GenericType, lambda: String): IntermediateStreamCall =
|
||||
OnEachCall(elementsType, lambda)
|
||||
|
||||
-3
@@ -6,9 +6,6 @@ import com.intellij.debugger.streams.trace.dsl.Expression
|
||||
import com.intellij.debugger.streams.trace.dsl.ForLoopBody
|
||||
import com.intellij.debugger.streams.trace.dsl.Variable
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinForEachLoop(
|
||||
private val iterateVariable: Variable,
|
||||
private val collection: Expression,
|
||||
|
||||
-3
@@ -6,9 +6,6 @@ import com.intellij.debugger.streams.trace.dsl.Expression
|
||||
import com.intellij.debugger.streams.trace.dsl.ForLoopBody
|
||||
import com.intellij.debugger.streams.trace.dsl.VariableDeclaration
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinForLoop(
|
||||
private val initialization: VariableDeclaration,
|
||||
private val condition: Expression,
|
||||
|
||||
-3
@@ -7,9 +7,6 @@ import com.intellij.debugger.streams.trace.dsl.StatementFactory
|
||||
import com.intellij.debugger.streams.trace.dsl.Variable
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.TextExpression
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinForLoopBody(
|
||||
override val loopVariable: Variable,
|
||||
statementFactory: StatementFactory
|
||||
|
||||
-3
@@ -6,9 +6,6 @@ import com.intellij.debugger.streams.trace.dsl.Expression
|
||||
import com.intellij.debugger.streams.trace.dsl.StatementFactory
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.common.IfBranchBase
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinIfBranch(condition: Expression, thenBlock: CodeBlock, statementFactory: StatementFactory) :
|
||||
IfBranchBase(condition, thenBlock, statementFactory) {
|
||||
override fun toCode(indent: Int): String {
|
||||
|
||||
-3
@@ -6,9 +6,6 @@ import com.intellij.debugger.streams.trace.dsl.Expression
|
||||
import com.intellij.debugger.streams.trace.dsl.Lambda
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.TextExpression
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinLambda(override val variableName: String, override val body: CodeBlock) : Lambda {
|
||||
override fun call(callName: String, vararg args: Expression): Expression = TextExpression("(${toCode()})").call(callName, *args)
|
||||
|
||||
|
||||
-3
@@ -5,8 +5,5 @@ import com.intellij.debugger.streams.trace.dsl.Expression
|
||||
import com.intellij.debugger.streams.trace.dsl.LambdaBody
|
||||
import com.intellij.debugger.streams.trace.dsl.StatementFactory
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinLambdaBody(override val lambdaArg: Expression, statementFactory: StatementFactory) : KotlinCodeBlock(statementFactory),
|
||||
LambdaBody
|
||||
|
||||
-3
@@ -7,9 +7,6 @@ import com.intellij.debugger.streams.trace.dsl.VariableDeclaration
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.VariableImpl
|
||||
import com.intellij.debugger.streams.trace.impl.handler.type.ListType
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinListVariable(override val type: ListType, name: String) : VariableImpl(type, name), ListVariable {
|
||||
override fun get(index: Expression): Expression = call("get", index)
|
||||
override fun set(index: Expression, newValue: Expression): Expression = call("set", index, newValue)
|
||||
|
||||
-3
@@ -8,9 +8,6 @@ import com.intellij.debugger.streams.trace.dsl.impl.TextExpression
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.common.MapVariableBase
|
||||
import com.intellij.debugger.streams.trace.impl.handler.type.MapType
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinMapVariable(type: MapType, name: String) : MapVariableBase(type, name) {
|
||||
override fun get(key: Expression): Expression = this.call("getValue", key)
|
||||
|
||||
|
||||
-3
@@ -8,9 +8,6 @@ import com.intellij.debugger.streams.trace.dsl.impl.VariableImpl
|
||||
import com.intellij.debugger.streams.trace.impl.handler.type.GenericType
|
||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinStatementFactory(private val peekCallFactory: PeekCallFactory) : StatementFactory {
|
||||
override fun createNewListExpression(elementType: GenericType, vararg args: Expression): Expression =
|
||||
TextExpression("kotlin.collections.mutableListOf<${elementType.genericTypeName}>(${StatementFactory.commaSeparate(*args)})")
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.trace.dsl.CodeBlock
|
||||
import com.intellij.debugger.streams.trace.dsl.StatementFactory
|
||||
import com.intellij.debugger.streams.trace.dsl.impl.common.TryBlockBase
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinTryBlock(private val block: CodeBlock, statementFactory: StatementFactory) : TryBlockBase(statementFactory) {
|
||||
override fun toCode(indent: Int): String {
|
||||
val descriptor = myCatchDescriptor ?: error("catch block must be specified")
|
||||
|
||||
@@ -4,9 +4,6 @@ package org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl
|
||||
import com.intellij.debugger.streams.trace.dsl.Types
|
||||
import com.intellij.debugger.streams.trace.impl.handler.type.*
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
object KotlinTypes : Types {
|
||||
override val ANY: GenericType = ClassTypeImpl("kotlin.Any", "kotlin.Any()")
|
||||
|
||||
|
||||
-3
@@ -4,9 +4,6 @@ package org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl
|
||||
import com.intellij.debugger.streams.trace.dsl.Variable
|
||||
import com.intellij.debugger.streams.trace.dsl.VariableDeclaration
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinVariableDeclaration(
|
||||
override val variable: Variable,
|
||||
override val isMutable: Boolean,
|
||||
|
||||
-3
@@ -4,9 +4,6 @@ package org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl
|
||||
import com.intellij.debugger.streams.trace.impl.handler.type.GenericType
|
||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
interface PeekCallFactory {
|
||||
fun createPeekCall(elementsType: GenericType, lambda: String): IntermediateStreamCall
|
||||
}
|
||||
-3
@@ -7,9 +7,6 @@ import com.intellij.debugger.streams.trace.impl.TraceExpressionBuilderBase
|
||||
import com.intellij.debugger.streams.wrapper.StreamChain
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinTraceExpressionBuilder(dsl: Dsl, handlerFactory: HandlerFactory) : TraceExpressionBuilderBase(dsl, handlerFactory) {
|
||||
private companion object {
|
||||
private val LOG = Logger.getInstance(KotlinTraceExpressionBuilder::class.java)
|
||||
|
||||
-3
@@ -6,9 +6,6 @@ import com.intellij.debugger.streams.wrapper.impl.IntermediateStreamCallImpl
|
||||
import com.intellij.debugger.streams.wrapper.impl.TerminatorStreamCallImpl
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
fun IntermediateStreamCall.withArgs(args: List<CallArgument>) =
|
||||
IntermediateStreamCallImpl(name, args, typeBefore, typeAfter, textRange)
|
||||
|
||||
|
||||
-3
@@ -9,9 +9,6 @@ import com.intellij.debugger.streams.wrapper.impl.CallArgumentImpl
|
||||
import com.intellij.openapi.util.TextRange
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class OnEachCall(private val elementsType: GenericType, lambda: String) : IntermediateStreamCall {
|
||||
private val args: List<CallArgument>
|
||||
|
||||
|
||||
-2
@@ -10,8 +10,6 @@ import com.intellij.debugger.streams.wrapper.TerminatorStreamCall
|
||||
/**
|
||||
* Unlike java streams, most operations in kotlin collections are intermediate and terminal simultaneously.
|
||||
* To avoid using of the same code in two places we will implement common logic in the {@link BothSemanticsHandler}.
|
||||
*
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class BothSemanticHandlerWrapper(private val handler: BothSemanticsHandler) {
|
||||
fun createIntermediateHandler(order: Int, call: IntermediateStreamCall, dsl: Dsl): IntermediateCallHandler =
|
||||
|
||||
-3
@@ -6,9 +6,6 @@ import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||
import com.intellij.debugger.streams.wrapper.StreamCall
|
||||
import com.intellij.debugger.streams.wrapper.TerminatorStreamCall
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
interface BothSemanticsHandler {
|
||||
fun variablesDeclaration(call: StreamCall, order: Int, dsl: Dsl): List<VariableDeclaration>
|
||||
|
||||
|
||||
-3
@@ -8,9 +8,6 @@ import com.intellij.debugger.streams.trace.dsl.Variable
|
||||
import com.intellij.debugger.streams.trace.dsl.VariableDeclaration
|
||||
import com.intellij.debugger.streams.wrapper.StreamCall
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
abstract class CollectionHandlerBase(
|
||||
order: Int, private val dsl: Dsl,
|
||||
private val call: StreamCall, private val internalHandler: BothSemanticsHandler
|
||||
|
||||
-3
@@ -7,9 +7,6 @@ import com.intellij.debugger.streams.trace.dsl.Dsl
|
||||
import com.intellij.debugger.streams.trace.dsl.Expression
|
||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class CollectionIntermediateHandler(
|
||||
order: Int,
|
||||
private val call: IntermediateStreamCall,
|
||||
|
||||
-3
@@ -9,9 +9,6 @@ import com.intellij.debugger.streams.trace.dsl.impl.TextExpression
|
||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||
import com.intellij.debugger.streams.wrapper.TerminatorStreamCall
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class CollectionTerminatorHandler(
|
||||
private val call: TerminatorStreamCall,
|
||||
private val resultExpression: String,
|
||||
|
||||
-3
@@ -12,9 +12,6 @@ import com.intellij.debugger.streams.wrapper.impl.CallArgumentImpl
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.typeBefore
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.withArgs
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class FilterCallHandler : BothSemanticsHandler {
|
||||
private companion object {
|
||||
const val VALUES_ARRAY_NAME = "objectsInPredicate"
|
||||
|
||||
-3
@@ -14,9 +14,6 @@ import com.intellij.debugger.streams.wrapper.impl.IntermediateStreamCallImpl
|
||||
import com.intellij.openapi.util.TextRange.EMPTY_RANGE
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class FilterIsInstanceHandler(num: Int, call: IntermediateStreamCall, dsl: Dsl) : HandlerBase.Intermediate(dsl) {
|
||||
private companion object {
|
||||
fun createHandler(num: Int, call: IntermediateStreamCall, dsl: Dsl): HandlerBase.Intermediate =
|
||||
|
||||
-1
@@ -14,7 +14,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||
|
||||
/**
|
||||
* Based on com.intellij.debugger.streams.trace.impl.handler.unified.DistinctByKeyHandler
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinDistinctByHandler(callNumber: Int, private val call: IntermediateStreamCall, dsl: Dsl) : HandlerBase.Intermediate(dsl) {
|
||||
private companion object {
|
||||
|
||||
-3
@@ -12,9 +12,6 @@ import com.sun.jdi.BooleanValue
|
||||
import com.sun.jdi.IntegerValue
|
||||
import com.sun.jdi.Value
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class FilterTraceInterpreter(private val predicateValueToAccept: Boolean) : CallTraceInterpreter {
|
||||
override fun resolve(call: StreamCall, value: Value): TraceInfo {
|
||||
if (value !is ArrayReference) throw UnexpectedValueTypeException("array reference excepted, but actual: ${value.type().name()}")
|
||||
|
||||
-3
@@ -6,9 +6,6 @@ import com.intellij.debugger.streams.trace.impl.interpret.ex.UnexpectedValueExce
|
||||
import com.sun.jdi.ArrayReference
|
||||
import com.sun.jdi.Value
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
object InterpreterUtil {
|
||||
|
||||
fun extractMap(value: Value): MapRepresentation {
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.trace.TraceElement
|
||||
import com.intellij.debugger.streams.trace.TraceInfo
|
||||
import com.intellij.debugger.streams.wrapper.StreamCall
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class ValuesOrder(
|
||||
private val call: StreamCall,
|
||||
private val before: Map<Int, TraceElement>,
|
||||
|
||||
-3
@@ -25,9 +25,6 @@ import java.io.File
|
||||
import java.nio.file.Paths
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
abstract class KotlinPsiChainBuilderTestCase(private val relativePath: String) : StreamChainBuilderTestCase() {
|
||||
override fun getTestDataPath(): String =
|
||||
Paths.get(File("").absolutePath, "idea/testData/debugger/sequence/psi/$relativeTestPath/").toString()
|
||||
|
||||
@@ -6,9 +6,6 @@ import com.intellij.debugger.streams.trace.dsl.impl.DslImpl
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinCollectionsPeekCallFactory
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinStatementFactory
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class KotlinDslTest : DslTestCase(DslImpl(KotlinStatementFactory(KotlinCollectionsPeekCallFactory()))) {
|
||||
override fun getTestDataPath(): String {
|
||||
return "idea/testData/debugger/sequence/dsl"
|
||||
|
||||
-3
@@ -8,9 +8,6 @@ package org.jetbrains.kotlin.idea.debugger.sequence.exec
|
||||
import com.intellij.debugger.streams.lib.LibrarySupportProvider
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.collections.KotlinCollectionSupportProvider
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
@Suppress("unused")
|
||||
abstract class AbstractCollectionTraceTestCase : KotlinTraceTestCase() {
|
||||
override val librarySupportProvider: LibrarySupportProvider = KotlinCollectionSupportProvider()
|
||||
|
||||
-3
@@ -8,9 +8,6 @@ package org.jetbrains.kotlin.idea.debugger.sequence.exec
|
||||
import com.intellij.debugger.streams.lib.LibrarySupportProvider
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
@Suppress("unused")
|
||||
abstract class AbstractJavaStreamTraceTestCase : KotlinTraceTestCase() {
|
||||
override val librarySupportProvider: LibrarySupportProvider = JavaStandardLibrarySupportProvider()
|
||||
|
||||
-3
@@ -8,9 +8,6 @@ package org.jetbrains.kotlin.idea.debugger.sequence.exec
|
||||
import com.intellij.debugger.streams.lib.LibrarySupportProvider
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.sequence.KotlinSequenceSupportProvider
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
abstract class AbstractSequenceTraceTestCase : KotlinTraceTestCase() {
|
||||
override val librarySupportProvider: LibrarySupportProvider = KotlinSequenceSupportProvider()
|
||||
}
|
||||
@@ -29,9 +29,6 @@ import java.io.File
|
||||
import java.nio.file.Paths
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() {
|
||||
private companion object {
|
||||
val DEFAULT_CHAIN_SELECTOR = ChainSelector.byIndex(0)
|
||||
|
||||
@@ -15,9 +15,6 @@ import junit.framework.TestCase
|
||||
import one.util.streamex.StreamEx
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class StreamTraceChecker(private val testCase: ExecutionTestCase) {
|
||||
fun checkChain(trace: List<TraceInfo>) {
|
||||
for (info in trace) {
|
||||
|
||||
@@ -4,9 +4,6 @@ package org.jetbrains.kotlin.idea.debugger.sequence.psi
|
||||
import com.intellij.debugger.streams.trace.impl.handler.type.GenericType
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.KotlinPsiChainBuilderTestCase
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
abstract class TypedChainTestCase(relativePath: String) : KotlinPsiChainBuilderTestCase(relativePath) {
|
||||
|
||||
protected fun doTest(
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.wrapper.StreamChainBuilder
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.KotlinPsiChainBuilderTestCase
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.collections.KotlinCollectionSupportProvider
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class PositiveCollectionBuildTest : KotlinPsiChainBuilderTestCase.Positive("collection/positive") {
|
||||
override val kotlinChainBuilder: StreamChainBuilder = KotlinCollectionSupportProvider().chainBuilder
|
||||
|
||||
|
||||
-3
@@ -6,9 +6,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.lib.collections.KotlinCollect
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.psi.TypedChainTestCase
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class TypedCollectionChainTest : TypedChainTestCase("collection/positive/types") {
|
||||
override val kotlinChainBuilder: StreamChainBuilder = KotlinCollectionSupportProvider().chainBuilder
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.kotlin.idea.debugger.sequence.psi.java
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class AmbiguousChainsTest : PositiveJavaStreamTest("ambiguous") {
|
||||
fun testSimpleExpression() = doTest(2)
|
||||
|
||||
|
||||
-3
@@ -1,9 +1,6 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.kotlin.idea.debugger.sequence.psi.java
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class LocationPositiveChainTest : PositiveJavaStreamTest("location") {
|
||||
fun testAnonymousBody() = doTest()
|
||||
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.wrapper.StreamChainBuilder
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.KotlinPsiChainBuilderTestCase
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class NegativeJavaStreamTest : KotlinPsiChainBuilderTestCase.Negative("streams/negative") {
|
||||
override val kotlinChainBuilder: StreamChainBuilder = JavaStandardLibrarySupportProvider().chainBuilder
|
||||
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ import com.intellij.debugger.streams.wrapper.StreamChainBuilder
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.KotlinPsiChainBuilderTestCase
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
abstract class PositiveJavaStreamTest(subDirectory: String) : KotlinPsiChainBuilderTestCase.Positive("streams/positive/$subDirectory") {
|
||||
override val kotlinChainBuilder: StreamChainBuilder = JavaStandardLibrarySupportProvider().chainBuilder
|
||||
}
|
||||
@@ -9,9 +9,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes.INT
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes.LONG
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes.NULLABLE_ANY
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class TypedJavaChainTest : TypedChainTestCase("streams/positive/types") {
|
||||
override val kotlinChainBuilder: StreamChainBuilder = JavaStandardLibrarySupportProvider().chainBuilder
|
||||
|
||||
|
||||
-3
@@ -6,9 +6,6 @@ import org.jetbrains.kotlin.idea.debugger.sequence.lib.sequence.KotlinSequenceSu
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.psi.TypedChainTestCase
|
||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||
|
||||
/**
|
||||
* @author Vitaliy.Bibaev
|
||||
*/
|
||||
class TypedSequenceChain : TypedChainTestCase("sequence/positive/types") {
|
||||
override val kotlinChainBuilder: StreamChainBuilder = KotlinSequenceSupportProvider().chainBuilder
|
||||
|
||||
|
||||
Reference in New Issue
Block a user