diff --git a/plugins/kotlin/jvm-debugger/core/resources/messages/KotlinDebuggerCoreBundle.properties b/plugins/kotlin/jvm-debugger/core/resources/messages/KotlinDebuggerCoreBundle.properties index 3756e141f7d1..62af6cf63c05 100644 --- a/plugins/kotlin/jvm-debugger/core/resources/messages/KotlinDebuggerCoreBundle.properties +++ b/plugins/kotlin/jvm-debugger/core/resources/messages/KotlinDebuggerCoreBundle.properties @@ -18,4 +18,7 @@ variables.calculate.delegated.property.values=Calculate values of delegated prop field.watchpoint.tab.title=Kotlin Field Watchpoints field.watchpoint.properties.access=Field &access field.watchpoint.properties.modification=Field &modification -field.watchpoint.properties.initialization=Field &initialization \ No newline at end of file +field.watchpoint.properties.initialization=Field &initialization +couldn.t.find.0.class=Couldn''t find ''{0}'' class +process.resumed=Process resumed +stepping.over.inline=Stepping over inline \ No newline at end of file diff --git a/plugins/kotlin/jvm-debugger/core/src/org/jetbrains/kotlin/idea/debugger/breakpoints/KotlinFieldBreakpointType.kt b/plugins/kotlin/jvm-debugger/core/src/org/jetbrains/kotlin/idea/debugger/breakpoints/KotlinFieldBreakpointType.kt index 6f3823389b47..3018b14dcaf1 100644 --- a/plugins/kotlin/jvm-debugger/core/src/org/jetbrains/kotlin/idea/debugger/breakpoints/KotlinFieldBreakpointType.kt +++ b/plugins/kotlin/jvm-debugger/core/src/org/jetbrains/kotlin/idea/debugger/breakpoints/KotlinFieldBreakpointType.kt @@ -76,7 +76,7 @@ class KotlinFieldBreakpointType : val psiClass = JavaPsiFacade.getInstance(project).findClass(className, GlobalSearchScope.allScope(project)) if (psiClass !is KtLightClass) { - reportError(project, "Couldn't find '$className' class") + reportError(project, KotlinDebuggerCoreBundle.message("couldn.t.find.0.class", className)) return false } diff --git a/plugins/kotlin/jvm-debugger/core/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinStepActionFactory.kt b/plugins/kotlin/jvm-debugger/core/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinStepActionFactory.kt index 24edde17b0db..35fbad9284cc 100644 --- a/plugins/kotlin/jvm-debugger/core/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinStepActionFactory.kt +++ b/plugins/kotlin/jvm-debugger/core/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinStepActionFactory.kt @@ -28,6 +28,7 @@ import com.intellij.openapi.project.Project import com.intellij.util.EventDispatcher import com.sun.jdi.request.EventRequest import com.sun.jdi.request.StepRequest +import org.jetbrains.kotlin.idea.debugger.KotlinDebuggerCoreBundle import java.lang.reflect.Field // Mass-copy-paste code for commands behaviour from com.intellij.debugger.engine.DebugProcessImpl @@ -126,7 +127,7 @@ class KotlinStepActionFactory(private val debuggerProcess: DebugProcessImpl) { // See: StepIntoCommand.contextAction() override fun contextAction(suspendContext: SuspendContextImpl) { - showStatusText("Stepping over inline") + showStatusText(KotlinDebuggerCoreBundle.message("stepping.over.inline")) val stepThread = getContextThread(suspendContext) if (stepThread == null) { @@ -148,7 +149,7 @@ class KotlinStepActionFactory(private val debuggerProcess: DebugProcessImpl) { doStep(suspendContext, stepThread, myStepSize, StepRequest.STEP_OVER, hint) - showStatusText("Process resumed") + showStatusText(KotlinDebuggerCoreBundle.message("process.resumed")) resumeAction(suspendContext, stepThread) debugProcessDispatcher.multicaster.resumed(suspendContext) } diff --git a/plugins/kotlin/jvm-debugger/evaluation/resources/messages/KotlinDebuggerEvaluationBundle.properties b/plugins/kotlin/jvm-debugger/evaluation/resources/messages/KotlinDebuggerEvaluationBundle.properties index 30d610a3f55f..c2ef3b27ac59 100644 --- a/plugins/kotlin/jvm-debugger/evaluation/resources/messages/KotlinDebuggerEvaluationBundle.properties +++ b/plugins/kotlin/jvm-debugger/evaluation/resources/messages/KotlinDebuggerEvaluationBundle.properties @@ -20,4 +20,7 @@ error.not.captured=''{0}'' is not captured error.cant.find.backing.field=Cannot find the backing field ''{0}'' error.parameter.evaluation.default.methods=Parameter evaluation is not supported for '$default' methods error.cant.find.variable=Cannot find local variable ''{0}'' with type {1} -error.cant.find.class=Cannot find class ''{0}'' in the current ClassLoader \ No newline at end of file +error.cant.find.class=Cannot find class ''{0}'' in the current ClassLoader +java.field=Java field +backing.field=Backing field +wrap.with.tostring=Wrap with 'toString()' \ No newline at end of file diff --git a/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/DebuggerFieldSyntheticScopeProvider.kt b/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/DebuggerFieldSyntheticScopeProvider.kt index e405462c65a0..58d3e191ca53 100644 --- a/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/DebuggerFieldSyntheticScopeProvider.kt +++ b/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/DebuggerFieldSyntheticScopeProvider.kt @@ -24,12 +24,12 @@ import org.jetbrains.kotlin.load.java.lazy.types.toAttributes import org.jetbrains.kotlin.load.java.structure.classId import org.jetbrains.kotlin.load.kotlin.internalName import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.platform.isCommon +import org.jetbrains.kotlin.platform.jvm.isJvm import org.jetbrains.kotlin.psi.KtCodeFragment import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.resolve.DescriptorFactory import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassNotAny -import org.jetbrains.kotlin.platform.isCommon -import org.jetbrains.kotlin.platform.jvm.isJvm import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.resolve.scopes.SyntheticScope import org.jetbrains.kotlin.resolve.scopes.getDescriptorsFiltered @@ -125,7 +125,14 @@ class DebuggerFieldSyntheticScope(val javaSyntheticPropertiesScope: JavaSyntheti val sourceElement = propertyDescriptor.source val isVar = propertyDescriptor.isVar - consumer[name] = createSyntheticPropertyDescriptor(clazz, type, name, isVar, "Backing field", sourceElement) { state -> + consumer[name] = createSyntheticPropertyDescriptor( + clazz, + type, + name, + isVar, + KotlinDebuggerEvaluationBundle.message("backing.field"), + sourceElement + ) { state -> state.typeMapper.mapType(clazz.defaultType) } } @@ -149,7 +156,14 @@ class DebuggerFieldSyntheticScope(val javaSyntheticPropertiesScope: JavaSyntheti val sourceElement = javaSourceElementFactory.source(field) val isVar = !field.isFinal - consumer[fieldName] = createSyntheticPropertyDescriptor(clazz, type, fieldName, isVar, "Java field", sourceElement) { + consumer[fieldName] = createSyntheticPropertyDescriptor( + clazz, + type, + fieldName, + isVar, + KotlinDebuggerEvaluationBundle.message("java.field"), + sourceElement + ) { Type.getObjectType(ownerClassName) } } diff --git a/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluatorBuilder.kt b/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluatorBuilder.kt index a6befdcb4781..19b6add72eac 100644 --- a/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluatorBuilder.kt +++ b/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluatorBuilder.kt @@ -260,7 +260,7 @@ class KotlinEvaluator(val codeFragment: KtCodeFragment, private val sourcePositi KtPsiFactory(expression.project).createExpression("($expressionText).toString()") } runInEdtAndWait { - expression.project.executeWriteCommand("Wrap with 'toString()'") { + expression.project.executeWriteCommand(KotlinDebuggerEvaluationBundle.message("wrap.with.tostring")) { expression.replace(newExpression) } } diff --git a/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/lib/sequence/KotlinSequencesSupport.kt b/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/lib/sequence/KotlinSequencesSupport.kt index 327f8d629192..ece3e57218a2 100644 --- a/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/lib/sequence/KotlinSequencesSupport.kt +++ b/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/lib/sequence/KotlinSequencesSupport.kt @@ -11,6 +11,7 @@ import com.intellij.debugger.streams.resolve.AppendResolver import com.intellij.debugger.streams.resolve.PairMapResolver import com.intellij.debugger.streams.trace.impl.handler.unified.DistinctTraceHandler import com.intellij.debugger.streams.trace.impl.interpret.SimplePeekCallTraceInterpreter +import org.jetbrains.annotations.NonNls import org.jetbrains.kotlin.idea.debugger.sequence.resolve.ChunkedResolver import org.jetbrains.kotlin.idea.debugger.sequence.resolve.FilteredMapResolver import org.jetbrains.kotlin.idea.debugger.sequence.resolve.WindowedResolver @@ -52,16 +53,16 @@ class KotlinSequencesSupport : LibrarySupportBase() { addIntermediateOperationsSupport(OrderBasedOperation("windowed", WindowedResolver())) } - private fun filterOperations(vararg names: String): Array = + private fun filterOperations(@NonNls vararg names: String): Array = names.map { FilterOperation(it) }.toTypedArray() - private fun mapOperations(vararg names: String): Array = + private fun mapOperations(@NonNls vararg names: String): Array = names.map { MappingOperation(it) }.toTypedArray() - private fun flatMapOperations(vararg names: String): Array = + private fun flatMapOperations(@NonNls vararg names: String): Array = names.map { FlatMappingOperation(it) }.toTypedArray() - private fun sortedOperations(vararg names: String): Array = + private fun sortedOperations(@NonNls vararg names: String): Array = names.map { SortedOperation(it) }.toTypedArray() private class FilterIsInstanceOperationHandler : IntermediateOperationBase( diff --git a/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/StandardLibraryCallChecker.kt b/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/StandardLibraryCallChecker.kt index e56db294a657..e5b4c23697a6 100644 --- a/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/StandardLibraryCallChecker.kt +++ b/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/StandardLibraryCallChecker.kt @@ -5,11 +5,13 @@ package org.jetbrains.kotlin.idea.debugger.sequence.psi.java +import org.jetbrains.annotations.NonNls import org.jetbrains.kotlin.idea.debugger.sequence.psi.CallCheckerWithNameHeuristics import org.jetbrains.kotlin.idea.debugger.sequence.psi.StreamCallChecker class StandardLibraryCallChecker(nestedChecker: StreamCallChecker) : CallCheckerWithNameHeuristics(nestedChecker) { private companion object { + @NonNls val TERMINATION_CALLS: Set = setOf( "forEach", "toArray", "reduce", "collect", "min", "max", "count", "sum", "anyMatch", "allMatch", "noneMatch", "findFirst", "findAny", "forEachOrdered", "average", "summaryStatistics" diff --git a/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/StreamExCallChecker.kt b/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/StreamExCallChecker.kt index 4764168094dc..a92c87177430 100644 --- a/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/StreamExCallChecker.kt +++ b/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/StreamExCallChecker.kt @@ -5,11 +5,13 @@ package org.jetbrains.kotlin.idea.debugger.sequence.psi.java +import org.jetbrains.annotations.NonNls import org.jetbrains.kotlin.idea.debugger.sequence.psi.CallCheckerWithNameHeuristics import org.jetbrains.kotlin.idea.debugger.sequence.psi.StreamCallChecker class StreamExCallChecker(nestedChecker: StreamCallChecker) : CallCheckerWithNameHeuristics(nestedChecker) { private companion object { + @NonNls val TERMINATION_CALLS: Set = setOf( "forEach", "toArray", "reduce", "collect", "min", "max", "count", "sum", "anyMatch", "allMatch", "noneMatch", "findFirst", "findAny", "forEachOrdered", "average", "summaryStatistics", "toList", "toSet", "toCollection", "toListAndThen", "toSetAndThen", diff --git a/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/sequence/SequenceCallCheckerWithNameHeuristics.kt b/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/sequence/SequenceCallCheckerWithNameHeuristics.kt index f3679db293cf..a94ebf8cb233 100644 --- a/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/sequence/SequenceCallCheckerWithNameHeuristics.kt +++ b/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/psi/sequence/SequenceCallCheckerWithNameHeuristics.kt @@ -5,12 +5,13 @@ package org.jetbrains.kotlin.idea.debugger.sequence.psi.sequence +import org.jetbrains.annotations.NonNls import org.jetbrains.kotlin.idea.debugger.sequence.psi.CallCheckerWithNameHeuristics import org.jetbrains.kotlin.idea.debugger.sequence.psi.StreamCallChecker class SequenceCallCheckerWithNameHeuristics(nestedChecker: StreamCallChecker) : CallCheckerWithNameHeuristics(nestedChecker) { private companion object { - + @NonNls val TERMINATION_CALLS: Set = setOf( "all", "any", "associate", "associateBy", "associateByTo", "associateTo", "average", "chunked", "contains", "count", "distinct", "distinctBy", "elementAt", "elementAtOrElse", "elementAtOrNull", "find", "findLast", "first", "firstOrNull", "fold", diff --git a/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/trace/dsl/KotlinStatementFactory.kt b/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/trace/dsl/KotlinStatementFactory.kt index 1fe81ca7a939..32dc75e22252 100644 --- a/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/trace/dsl/KotlinStatementFactory.kt +++ b/plugins/kotlin/jvm-debugger/sequence/src/org/jetbrains/kotlin/idea/debugger/sequence/trace/dsl/KotlinStatementFactory.kt @@ -11,6 +11,7 @@ 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.GenericType import com.intellij.debugger.streams.wrapper.IntermediateStreamCall +import org.jetbrains.annotations.NonNls class KotlinStatementFactory(private val peekCallFactory: PeekCallFactory) : StatementFactory { override fun createNewListExpression(elementType: GenericType, vararg args: Expression): Expression = @@ -87,6 +88,8 @@ class KotlinStatementFactory(private val peekCallFactory: PeekCallFactory) : Sta override fun createNewArrayExpression(elementType: GenericType, vararg args: Expression): Expression { val arguments = args.joinToString { it.toCode() } + + @NonNls val text = when (elementType) { types.BOOLEAN -> "kotlin.booleanArrayOf($arguments)" KotlinSequenceTypes.BYTE -> "kotlin.byteArrayOf($arguments)"