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.handler.collections.FilterCallHandler
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.interpret.FilterTraceInterpreter
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.interpret.FilterTraceInterpreter
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinCollectionLibrarySupport : LibrarySupportBase() {
|
class KotlinCollectionLibrarySupport : LibrarySupportBase() {
|
||||||
init {
|
init {
|
||||||
addOperation(FilterOperation("filter", FilterCallHandler(), true))
|
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.dsl.KotlinStatementFactory
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinCollectionSupportProvider : LibrarySupportProvider {
|
class KotlinCollectionSupportProvider : LibrarySupportProvider {
|
||||||
private companion object {
|
private companion object {
|
||||||
val builder: StreamChainBuilder = KotlinCollectionChainBuilder()
|
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.dsl.KotlinStatementFactory
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class JavaStandardLibrarySupportProvider : LibrarySupportProvider {
|
class JavaStandardLibrarySupportProvider : LibrarySupportProvider {
|
||||||
private companion object {
|
private companion object {
|
||||||
val builder = TerminatedChainBuilder(
|
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.dsl.KotlinStatementFactory
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class StreamExLibrarySupportProvider : LibrarySupportProvider {
|
class StreamExLibrarySupportProvider : LibrarySupportProvider {
|
||||||
private companion object {
|
private companion object {
|
||||||
val streamChainBuilder = TerminatedChainBuilder(
|
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.dsl.KotlinStatementFactory
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.KotlinTraceExpressionBuilder
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinSequenceSupportProvider : LibrarySupportProvider {
|
class KotlinSequenceSupportProvider : LibrarySupportProvider {
|
||||||
override fun getLanguageId(): String = KotlinLanguage.INSTANCE.id
|
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.FilterIsInstanceHandler
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.sequence.KotlinDistinctByHandler
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.sequence.KotlinDistinctByHandler
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinSequencesSupport : LibrarySupportBase() {
|
class KotlinSequencesSupport : LibrarySupportBase() {
|
||||||
init {
|
init {
|
||||||
addIntermediateOperationsSupport(
|
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.psi.KtCallExpression
|
||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
interface CallTypeExtractor {
|
interface CallTypeExtractor {
|
||||||
fun extractIntermediateCallTypes(call: KtCallExpression): IntermediateCallTypes
|
fun extractIntermediateCallTypes(call: KtCallExpression): IntermediateCallTypes
|
||||||
fun extractTerminalCallTypes(call: KtCallExpression): TerminatorCallTypes
|
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.FlexibleType
|
||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
|
|
||||||
object KotlinPsiUtil {
|
object KotlinPsiUtil {
|
||||||
private val WITH_TYPES_RENDERER = DescriptorRenderer.FQ_NAMES_IN_TYPES
|
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
|
import org.jetbrains.kotlin.psi.KtCallExpression
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
interface StreamCallChecker {
|
interface StreamCallChecker {
|
||||||
fun isIntermediateCall(expression: KtCallExpression): Boolean
|
fun isIntermediateCall(expression: KtCallExpression): Boolean
|
||||||
fun isTerminationCall(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.psi.KtCallExpression
|
||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class CollectionChainTransformer : ChainTransformer<KtCallExpression> {
|
class CollectionChainTransformer : ChainTransformer<KtCallExpression> {
|
||||||
private val transformer = KotlinChainTransformerImpl(KotlinCollectionsTypeExtractor())
|
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.KotlinType
|
||||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinCollectionChainBuilder
|
class KotlinCollectionChainBuilder
|
||||||
: KotlinChainBuilderBase(CollectionChainTransformer()) {
|
: KotlinChainBuilderBase(CollectionChainTransformer()) {
|
||||||
private companion object {
|
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.KotlinType
|
||||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinCollectionsTypeExtractor : CallTypeExtractor.Base() {
|
class KotlinCollectionsTypeExtractor : CallTypeExtractor.Base() {
|
||||||
private companion object {
|
private companion object {
|
||||||
val LOG = Logger.getInstance(KotlinCollectionsTypeExtractor::class.java)
|
val LOG = Logger.getInstance(KotlinCollectionsTypeExtractor::class.java)
|
||||||
|
|||||||
-3
@@ -9,9 +9,6 @@ import com.intellij.psi.PsiElement
|
|||||||
import com.intellij.psi.PsiWhiteSpace
|
import com.intellij.psi.PsiWhiteSpace
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
abstract class KotlinChainBuilderBase(private val transformer: ChainTransformer<KtCallExpression>) : StreamChainBuilder {
|
abstract class KotlinChainBuilderBase(private val transformer: ChainTransformer<KtCallExpression>) : StreamChainBuilder {
|
||||||
protected abstract val existenceChecker: ExistenceChecker
|
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.getParameterForArgument
|
||||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinChainTransformerImpl(private val typeExtractor: CallTypeExtractor) : ChainTransformer<KtCallExpression> {
|
class KotlinChainTransformerImpl(private val typeExtractor: CallTypeExtractor) : ChainTransformer<KtCallExpression> {
|
||||||
override fun transform(callChain: List<KtCallExpression>, context: PsiElement): StreamChain {
|
override fun transform(callChain: List<KtCallExpression>, context: PsiElement): StreamChain {
|
||||||
val intermediateCalls = mutableListOf<IntermediateStreamCall>()
|
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.psi.KtCallExpression
|
||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class PackageBasedCallChecker(private val supportedPackage: String) : StreamCallChecker {
|
class PackageBasedCallChecker(private val supportedPackage: String) : StreamCallChecker {
|
||||||
override fun isIntermediateCall(expression: KtCallExpression): Boolean {
|
override fun isIntermediateCall(expression: KtCallExpression): Boolean {
|
||||||
return checkReceiverSupported(expression) && checkResultSupported(expression, true)
|
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 org.jetbrains.kotlin.psi.KtCallExpression
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
open class TerminatedChainBuilder(
|
open class TerminatedChainBuilder(
|
||||||
transformer: ChainTransformer<KtCallExpression>,
|
transformer: ChainTransformer<KtCallExpression>,
|
||||||
private val callChecker: StreamCallChecker
|
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.KotlinType
|
||||||
import org.jetbrains.kotlin.types.typeUtil.getImmediateSuperclassNotAny
|
import org.jetbrains.kotlin.types.typeUtil.getImmediateSuperclassNotAny
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class JavaStreamChainTypeExtractor : CallTypeExtractor.Base() {
|
class JavaStreamChainTypeExtractor : CallTypeExtractor.Base() {
|
||||||
override fun extractItemsType(type: KotlinType?): GenericType {
|
override fun extractItemsType(type: KotlinType?): GenericType {
|
||||||
if (type == null) {
|
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.KotlinType
|
||||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class SequenceCallChecker : StreamCallChecker {
|
class SequenceCallChecker : StreamCallChecker {
|
||||||
override fun isIntermediateCall(expression: KtCallExpression): Boolean {
|
override fun isIntermediateCall(expression: KtCallExpression): Boolean {
|
||||||
val receiverType = expression.receiverType() ?: return false
|
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.KotlinType
|
||||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class SequenceTypeExtractor : CallTypeExtractor.Base() {
|
class SequenceTypeExtractor : CallTypeExtractor.Base() {
|
||||||
private companion object {
|
private companion object {
|
||||||
val LOG = Logger.getInstance(SequenceTypeExtractor::class.java)
|
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.TraceElement
|
||||||
import com.intellij.debugger.streams.trace.TraceInfo
|
import com.intellij.debugger.streams.trace.TraceInfo
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class ChunkedResolver : ValuesOrderResolver {
|
class ChunkedResolver : ValuesOrderResolver {
|
||||||
override fun resolve(info: TraceInfo): ValuesOrderResolver.Result {
|
override fun resolve(info: TraceInfo): ValuesOrderResolver.Result {
|
||||||
val beforeIndex = info.valuesOrderBefore
|
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.TraceElement
|
||||||
import com.intellij.debugger.streams.trace.TraceInfo
|
import com.intellij.debugger.streams.trace.TraceInfo
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class FilteredMapResolver : ValuesOrderResolver {
|
class FilteredMapResolver : ValuesOrderResolver {
|
||||||
override fun resolve(info: TraceInfo): ValuesOrderResolver.Result {
|
override fun resolve(info: TraceInfo): ValuesOrderResolver.Result {
|
||||||
val before = info.valuesOrderBefore
|
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.TraceElement
|
||||||
import com.intellij.debugger.streams.trace.TraceInfo
|
import com.intellij.debugger.streams.trace.TraceInfo
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class WindowedResolver : ValuesOrderResolver {
|
class WindowedResolver : ValuesOrderResolver {
|
||||||
override fun resolve(info: TraceInfo): ValuesOrderResolver.Result {
|
override fun resolve(info: TraceInfo): ValuesOrderResolver.Result {
|
||||||
val indexBefore = info.valuesOrderBefore
|
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.trace.impl.handler.type.GenericType
|
||||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class JavaPeekCallFactory : PeekCallFactory {
|
class JavaPeekCallFactory : PeekCallFactory {
|
||||||
override fun createPeekCall(elementsType: GenericType, lambda: String): IntermediateStreamCall =
|
override fun createPeekCall(elementsType: GenericType, lambda: String): IntermediateStreamCall =
|
||||||
PeekCall(lambda, elementsType)
|
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.dsl.impl.VariableImpl
|
||||||
import com.intellij.debugger.streams.trace.impl.handler.type.ArrayType
|
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 {
|
class KotlinArrayVariable(override val type: ArrayType, override val name: String) : VariableImpl(type, name), ArrayVariable {
|
||||||
override fun get(index: Expression): Expression = TextExpression("$name[${index.toCode()}]!!")
|
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.Variable
|
||||||
import com.intellij.debugger.streams.trace.dsl.impl.AssignmentStatement
|
import com.intellij.debugger.streams.trace.dsl.impl.AssignmentStatement
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinAssignmentStatement(override val variable: Variable, override val expression: Expression) : AssignmentStatement {
|
class KotlinAssignmentStatement(override val variable: Variable, override val expression: Expression) : AssignmentStatement {
|
||||||
override fun toCode(indent: Int): String = "${variable.toCode()} = ${expression.toCode()}".withIndent(indent)
|
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.StatementFactory
|
||||||
import com.intellij.debugger.streams.trace.dsl.impl.LineSeparatedCodeBlock
|
import com.intellij.debugger.streams.trace.dsl.impl.LineSeparatedCodeBlock
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
open class KotlinCodeBlock(statementFactory: StatementFactory) : LineSeparatedCodeBlock(statementFactory) {
|
open class KotlinCodeBlock(statementFactory: StatementFactory) : LineSeparatedCodeBlock(statementFactory) {
|
||||||
override fun doReturn(expression: Expression) = addStatement(expression)
|
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 com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.OnEachCall
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.OnEachCall
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinCollectionsPeekCallFactory : PeekCallFactory {
|
class KotlinCollectionsPeekCallFactory : PeekCallFactory {
|
||||||
override fun createPeekCall(elementsType: GenericType, lambda: String): IntermediateStreamCall =
|
override fun createPeekCall(elementsType: GenericType, lambda: String): IntermediateStreamCall =
|
||||||
OnEachCall(elementsType, lambda)
|
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.ForLoopBody
|
||||||
import com.intellij.debugger.streams.trace.dsl.Variable
|
import com.intellij.debugger.streams.trace.dsl.Variable
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinForEachLoop(
|
class KotlinForEachLoop(
|
||||||
private val iterateVariable: Variable,
|
private val iterateVariable: Variable,
|
||||||
private val collection: Expression,
|
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.ForLoopBody
|
||||||
import com.intellij.debugger.streams.trace.dsl.VariableDeclaration
|
import com.intellij.debugger.streams.trace.dsl.VariableDeclaration
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinForLoop(
|
class KotlinForLoop(
|
||||||
private val initialization: VariableDeclaration,
|
private val initialization: VariableDeclaration,
|
||||||
private val condition: Expression,
|
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.Variable
|
||||||
import com.intellij.debugger.streams.trace.dsl.impl.TextExpression
|
import com.intellij.debugger.streams.trace.dsl.impl.TextExpression
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinForLoopBody(
|
class KotlinForLoopBody(
|
||||||
override val loopVariable: Variable,
|
override val loopVariable: Variable,
|
||||||
statementFactory: StatementFactory
|
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.StatementFactory
|
||||||
import com.intellij.debugger.streams.trace.dsl.impl.common.IfBranchBase
|
import com.intellij.debugger.streams.trace.dsl.impl.common.IfBranchBase
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinIfBranch(condition: Expression, thenBlock: CodeBlock, statementFactory: StatementFactory) :
|
class KotlinIfBranch(condition: Expression, thenBlock: CodeBlock, statementFactory: StatementFactory) :
|
||||||
IfBranchBase(condition, thenBlock, statementFactory) {
|
IfBranchBase(condition, thenBlock, statementFactory) {
|
||||||
override fun toCode(indent: Int): String {
|
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.Lambda
|
||||||
import com.intellij.debugger.streams.trace.dsl.impl.TextExpression
|
import com.intellij.debugger.streams.trace.dsl.impl.TextExpression
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinLambda(override val variableName: String, override val body: CodeBlock) : Lambda {
|
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)
|
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.LambdaBody
|
||||||
import com.intellij.debugger.streams.trace.dsl.StatementFactory
|
import com.intellij.debugger.streams.trace.dsl.StatementFactory
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinLambdaBody(override val lambdaArg: Expression, statementFactory: StatementFactory) : KotlinCodeBlock(statementFactory),
|
class KotlinLambdaBody(override val lambdaArg: Expression, statementFactory: StatementFactory) : KotlinCodeBlock(statementFactory),
|
||||||
LambdaBody
|
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.dsl.impl.VariableImpl
|
||||||
import com.intellij.debugger.streams.trace.impl.handler.type.ListType
|
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 {
|
class KotlinListVariable(override val type: ListType, name: String) : VariableImpl(type, name), ListVariable {
|
||||||
override fun get(index: Expression): Expression = call("get", index)
|
override fun get(index: Expression): Expression = call("get", index)
|
||||||
override fun set(index: Expression, newValue: Expression): Expression = call("set", index, newValue)
|
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.dsl.impl.common.MapVariableBase
|
||||||
import com.intellij.debugger.streams.trace.impl.handler.type.MapType
|
import com.intellij.debugger.streams.trace.impl.handler.type.MapType
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinMapVariable(type: MapType, name: String) : MapVariableBase(type, name) {
|
class KotlinMapVariable(type: MapType, name: String) : MapVariableBase(type, name) {
|
||||||
override fun get(key: Expression): Expression = this.call("getValue", key)
|
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.trace.impl.handler.type.GenericType
|
||||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinStatementFactory(private val peekCallFactory: PeekCallFactory) : StatementFactory {
|
class KotlinStatementFactory(private val peekCallFactory: PeekCallFactory) : StatementFactory {
|
||||||
override fun createNewListExpression(elementType: GenericType, vararg args: Expression): Expression =
|
override fun createNewListExpression(elementType: GenericType, vararg args: Expression): Expression =
|
||||||
TextExpression("kotlin.collections.mutableListOf<${elementType.genericTypeName}>(${StatementFactory.commaSeparate(*args)})")
|
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.StatementFactory
|
||||||
import com.intellij.debugger.streams.trace.dsl.impl.common.TryBlockBase
|
import com.intellij.debugger.streams.trace.dsl.impl.common.TryBlockBase
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinTryBlock(private val block: CodeBlock, statementFactory: StatementFactory) : TryBlockBase(statementFactory) {
|
class KotlinTryBlock(private val block: CodeBlock, statementFactory: StatementFactory) : TryBlockBase(statementFactory) {
|
||||||
override fun toCode(indent: Int): String {
|
override fun toCode(indent: Int): String {
|
||||||
val descriptor = myCatchDescriptor ?: error("catch block must be specified")
|
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.dsl.Types
|
||||||
import com.intellij.debugger.streams.trace.impl.handler.type.*
|
import com.intellij.debugger.streams.trace.impl.handler.type.*
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
object KotlinTypes : Types {
|
object KotlinTypes : Types {
|
||||||
override val ANY: GenericType = ClassTypeImpl("kotlin.Any", "kotlin.Any()")
|
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.Variable
|
||||||
import com.intellij.debugger.streams.trace.dsl.VariableDeclaration
|
import com.intellij.debugger.streams.trace.dsl.VariableDeclaration
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinVariableDeclaration(
|
class KotlinVariableDeclaration(
|
||||||
override val variable: Variable,
|
override val variable: Variable,
|
||||||
override val isMutable: Boolean,
|
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.trace.impl.handler.type.GenericType
|
||||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
interface PeekCallFactory {
|
interface PeekCallFactory {
|
||||||
fun createPeekCall(elementsType: GenericType, lambda: String): IntermediateStreamCall
|
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.debugger.streams.wrapper.StreamChain
|
||||||
import com.intellij.openapi.diagnostic.Logger
|
import com.intellij.openapi.diagnostic.Logger
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinTraceExpressionBuilder(dsl: Dsl, handlerFactory: HandlerFactory) : TraceExpressionBuilderBase(dsl, handlerFactory) {
|
class KotlinTraceExpressionBuilder(dsl: Dsl, handlerFactory: HandlerFactory) : TraceExpressionBuilderBase(dsl, handlerFactory) {
|
||||||
private companion object {
|
private companion object {
|
||||||
private val LOG = Logger.getInstance(KotlinTraceExpressionBuilder::class.java)
|
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 com.intellij.debugger.streams.wrapper.impl.TerminatorStreamCallImpl
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
fun IntermediateStreamCall.withArgs(args: List<CallArgument>) =
|
fun IntermediateStreamCall.withArgs(args: List<CallArgument>) =
|
||||||
IntermediateStreamCallImpl(name, args, typeBefore, typeAfter, textRange)
|
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 com.intellij.openapi.util.TextRange
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class OnEachCall(private val elementsType: GenericType, lambda: String) : IntermediateStreamCall {
|
class OnEachCall(private val elementsType: GenericType, lambda: String) : IntermediateStreamCall {
|
||||||
private val args: List<CallArgument>
|
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.
|
* 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}.
|
* 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) {
|
class BothSemanticHandlerWrapper(private val handler: BothSemanticsHandler) {
|
||||||
fun createIntermediateHandler(order: Int, call: IntermediateStreamCall, dsl: Dsl): IntermediateCallHandler =
|
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.StreamCall
|
||||||
import com.intellij.debugger.streams.wrapper.TerminatorStreamCall
|
import com.intellij.debugger.streams.wrapper.TerminatorStreamCall
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
interface BothSemanticsHandler {
|
interface BothSemanticsHandler {
|
||||||
fun variablesDeclaration(call: StreamCall, order: Int, dsl: Dsl): List<VariableDeclaration>
|
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.trace.dsl.VariableDeclaration
|
||||||
import com.intellij.debugger.streams.wrapper.StreamCall
|
import com.intellij.debugger.streams.wrapper.StreamCall
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
abstract class CollectionHandlerBase(
|
abstract class CollectionHandlerBase(
|
||||||
order: Int, private val dsl: Dsl,
|
order: Int, private val dsl: Dsl,
|
||||||
private val call: StreamCall, private val internalHandler: BothSemanticsHandler
|
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.trace.dsl.Expression
|
||||||
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
import com.intellij.debugger.streams.wrapper.IntermediateStreamCall
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class CollectionIntermediateHandler(
|
class CollectionIntermediateHandler(
|
||||||
order: Int,
|
order: Int,
|
||||||
private val call: IntermediateStreamCall,
|
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.IntermediateStreamCall
|
||||||
import com.intellij.debugger.streams.wrapper.TerminatorStreamCall
|
import com.intellij.debugger.streams.wrapper.TerminatorStreamCall
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class CollectionTerminatorHandler(
|
class CollectionTerminatorHandler(
|
||||||
private val call: TerminatorStreamCall,
|
private val call: TerminatorStreamCall,
|
||||||
private val resultExpression: String,
|
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.typeBefore
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.withArgs
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.impl.handler.withArgs
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class FilterCallHandler : BothSemanticsHandler {
|
class FilterCallHandler : BothSemanticsHandler {
|
||||||
private companion object {
|
private companion object {
|
||||||
const val VALUES_ARRAY_NAME = "objectsInPredicate"
|
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 com.intellij.openapi.util.TextRange.EMPTY_RANGE
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class FilterIsInstanceHandler(num: Int, call: IntermediateStreamCall, dsl: Dsl) : HandlerBase.Intermediate(dsl) {
|
class FilterIsInstanceHandler(num: Int, call: IntermediateStreamCall, dsl: Dsl) : HandlerBase.Intermediate(dsl) {
|
||||||
private companion object {
|
private companion object {
|
||||||
fun createHandler(num: Int, call: IntermediateStreamCall, dsl: Dsl): HandlerBase.Intermediate =
|
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
|
* 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) {
|
class KotlinDistinctByHandler(callNumber: Int, private val call: IntermediateStreamCall, dsl: Dsl) : HandlerBase.Intermediate(dsl) {
|
||||||
private companion object {
|
private companion object {
|
||||||
|
|||||||
-3
@@ -12,9 +12,6 @@ import com.sun.jdi.BooleanValue
|
|||||||
import com.sun.jdi.IntegerValue
|
import com.sun.jdi.IntegerValue
|
||||||
import com.sun.jdi.Value
|
import com.sun.jdi.Value
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class FilterTraceInterpreter(private val predicateValueToAccept: Boolean) : CallTraceInterpreter {
|
class FilterTraceInterpreter(private val predicateValueToAccept: Boolean) : CallTraceInterpreter {
|
||||||
override fun resolve(call: StreamCall, value: Value): TraceInfo {
|
override fun resolve(call: StreamCall, value: Value): TraceInfo {
|
||||||
if (value !is ArrayReference) throw UnexpectedValueTypeException("array reference excepted, but actual: ${value.type().name()}")
|
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.ArrayReference
|
||||||
import com.sun.jdi.Value
|
import com.sun.jdi.Value
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
object InterpreterUtil {
|
object InterpreterUtil {
|
||||||
|
|
||||||
fun extractMap(value: Value): MapRepresentation {
|
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.trace.TraceInfo
|
||||||
import com.intellij.debugger.streams.wrapper.StreamCall
|
import com.intellij.debugger.streams.wrapper.StreamCall
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class ValuesOrder(
|
class ValuesOrder(
|
||||||
private val call: StreamCall,
|
private val call: StreamCall,
|
||||||
private val before: Map<Int, TraceElement>,
|
private val before: Map<Int, TraceElement>,
|
||||||
|
|||||||
-3
@@ -25,9 +25,6 @@ import java.io.File
|
|||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
abstract class KotlinPsiChainBuilderTestCase(private val relativePath: String) : StreamChainBuilderTestCase() {
|
abstract class KotlinPsiChainBuilderTestCase(private val relativePath: String) : StreamChainBuilderTestCase() {
|
||||||
override fun getTestDataPath(): String =
|
override fun getTestDataPath(): String =
|
||||||
Paths.get(File("").absolutePath, "idea/testData/debugger/sequence/psi/$relativeTestPath/").toString()
|
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.KotlinCollectionsPeekCallFactory
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinStatementFactory
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinStatementFactory
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class KotlinDslTest : DslTestCase(DslImpl(KotlinStatementFactory(KotlinCollectionsPeekCallFactory()))) {
|
class KotlinDslTest : DslTestCase(DslImpl(KotlinStatementFactory(KotlinCollectionsPeekCallFactory()))) {
|
||||||
override fun getTestDataPath(): String {
|
override fun getTestDataPath(): String {
|
||||||
return "idea/testData/debugger/sequence/dsl"
|
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 com.intellij.debugger.streams.lib.LibrarySupportProvider
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.collections.KotlinCollectionSupportProvider
|
import org.jetbrains.kotlin.idea.debugger.sequence.lib.collections.KotlinCollectionSupportProvider
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
abstract class AbstractCollectionTraceTestCase : KotlinTraceTestCase() {
|
abstract class AbstractCollectionTraceTestCase : KotlinTraceTestCase() {
|
||||||
override val librarySupportProvider: LibrarySupportProvider = KotlinCollectionSupportProvider()
|
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 com.intellij.debugger.streams.lib.LibrarySupportProvider
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider
|
import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
abstract class AbstractJavaStreamTraceTestCase : KotlinTraceTestCase() {
|
abstract class AbstractJavaStreamTraceTestCase : KotlinTraceTestCase() {
|
||||||
override val librarySupportProvider: LibrarySupportProvider = JavaStandardLibrarySupportProvider()
|
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 com.intellij.debugger.streams.lib.LibrarySupportProvider
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.sequence.KotlinSequenceSupportProvider
|
import org.jetbrains.kotlin.idea.debugger.sequence.lib.sequence.KotlinSequenceSupportProvider
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
abstract class AbstractSequenceTraceTestCase : KotlinTraceTestCase() {
|
abstract class AbstractSequenceTraceTestCase : KotlinTraceTestCase() {
|
||||||
override val librarySupportProvider: LibrarySupportProvider = KotlinSequenceSupportProvider()
|
override val librarySupportProvider: LibrarySupportProvider = KotlinSequenceSupportProvider()
|
||||||
}
|
}
|
||||||
@@ -29,9 +29,6 @@ import java.io.File
|
|||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
import java.util.concurrent.atomic.AtomicBoolean
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() {
|
abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() {
|
||||||
private companion object {
|
private companion object {
|
||||||
val DEFAULT_CHAIN_SELECTOR = ChainSelector.byIndex(0)
|
val DEFAULT_CHAIN_SELECTOR = ChainSelector.byIndex(0)
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ import junit.framework.TestCase
|
|||||||
import one.util.streamex.StreamEx
|
import one.util.streamex.StreamEx
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class StreamTraceChecker(private val testCase: ExecutionTestCase) {
|
class StreamTraceChecker(private val testCase: ExecutionTestCase) {
|
||||||
fun checkChain(trace: List<TraceInfo>) {
|
fun checkChain(trace: List<TraceInfo>) {
|
||||||
for (info in trace) {
|
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 com.intellij.debugger.streams.trace.impl.handler.type.GenericType
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.KotlinPsiChainBuilderTestCase
|
import org.jetbrains.kotlin.idea.debugger.sequence.KotlinPsiChainBuilderTestCase
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
abstract class TypedChainTestCase(relativePath: String) : KotlinPsiChainBuilderTestCase(relativePath) {
|
abstract class TypedChainTestCase(relativePath: String) : KotlinPsiChainBuilderTestCase(relativePath) {
|
||||||
|
|
||||||
protected fun doTest(
|
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.KotlinPsiChainBuilderTestCase
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.collections.KotlinCollectionSupportProvider
|
import org.jetbrains.kotlin.idea.debugger.sequence.lib.collections.KotlinCollectionSupportProvider
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class PositiveCollectionBuildTest : KotlinPsiChainBuilderTestCase.Positive("collection/positive") {
|
class PositiveCollectionBuildTest : KotlinPsiChainBuilderTestCase.Positive("collection/positive") {
|
||||||
override val kotlinChainBuilder: StreamChainBuilder = KotlinCollectionSupportProvider().chainBuilder
|
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.psi.TypedChainTestCase
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class TypedCollectionChainTest : TypedChainTestCase("collection/positive/types") {
|
class TypedCollectionChainTest : TypedChainTestCase("collection/positive/types") {
|
||||||
override val kotlinChainBuilder: StreamChainBuilder = KotlinCollectionSupportProvider().chainBuilder
|
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.
|
// 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
|
package org.jetbrains.kotlin.idea.debugger.sequence.psi.java
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class AmbiguousChainsTest : PositiveJavaStreamTest("ambiguous") {
|
class AmbiguousChainsTest : PositiveJavaStreamTest("ambiguous") {
|
||||||
fun testSimpleExpression() = doTest(2)
|
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.
|
// 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
|
package org.jetbrains.kotlin.idea.debugger.sequence.psi.java
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class LocationPositiveChainTest : PositiveJavaStreamTest("location") {
|
class LocationPositiveChainTest : PositiveJavaStreamTest("location") {
|
||||||
fun testAnonymousBody() = doTest()
|
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.KotlinPsiChainBuilderTestCase
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider
|
import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class NegativeJavaStreamTest : KotlinPsiChainBuilderTestCase.Negative("streams/negative") {
|
class NegativeJavaStreamTest : KotlinPsiChainBuilderTestCase.Negative("streams/negative") {
|
||||||
override val kotlinChainBuilder: StreamChainBuilder = JavaStandardLibrarySupportProvider().chainBuilder
|
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.KotlinPsiChainBuilderTestCase
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider
|
import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
abstract class PositiveJavaStreamTest(subDirectory: String) : KotlinPsiChainBuilderTestCase.Positive("streams/positive/$subDirectory") {
|
abstract class PositiveJavaStreamTest(subDirectory: String) : KotlinPsiChainBuilderTestCase.Positive("streams/positive/$subDirectory") {
|
||||||
override val kotlinChainBuilder: StreamChainBuilder = JavaStandardLibrarySupportProvider().chainBuilder
|
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.LONG
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes.NULLABLE_ANY
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes.NULLABLE_ANY
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class TypedJavaChainTest : TypedChainTestCase("streams/positive/types") {
|
class TypedJavaChainTest : TypedChainTestCase("streams/positive/types") {
|
||||||
override val kotlinChainBuilder: StreamChainBuilder = JavaStandardLibrarySupportProvider().chainBuilder
|
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.psi.TypedChainTestCase
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinTypes
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vitaliy.Bibaev
|
|
||||||
*/
|
|
||||||
class TypedSequenceChain : TypedChainTestCase("sequence/positive/types") {
|
class TypedSequenceChain : TypedChainTestCase("sequence/positive/types") {
|
||||||
override val kotlinChainBuilder: StreamChainBuilder = KotlinSequenceSupportProvider().chainBuilder
|
override val kotlinChainBuilder: StreamChainBuilder = KotlinSequenceSupportProvider().chainBuilder
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user