mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[debugger] Refactoring: extract SteppingAction from DebuggerStatistics to use it for stepping-kind tracking
IJ-MR-145237 GitOrigin-RevId: e878bbe490b961a81120b7cba8b9383c53305efb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
995b4b892b
commit
151b03f97d
@@ -26,7 +26,6 @@ import com.intellij.debugger.settings.NodeRendererSettings;
|
||||
import com.intellij.debugger.statistics.DebuggerStatistics;
|
||||
import com.intellij.debugger.statistics.Engine;
|
||||
import com.intellij.debugger.statistics.StatisticsStorage;
|
||||
import com.intellij.debugger.statistics.SteppingAction;
|
||||
import com.intellij.debugger.ui.breakpoints.*;
|
||||
import com.intellij.debugger.ui.tree.render.*;
|
||||
import com.intellij.execution.CantRunException;
|
||||
@@ -1953,8 +1952,8 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object createCommandToken() {
|
||||
return StatisticsStorage.createSteppingToken(SteppingAction.STEP_OUT, Engine.JAVA);
|
||||
protected @NotNull SteppingAction getSteppingAction() {
|
||||
return SteppingAction.STEP_OUT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2005,8 +2004,8 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object createCommandToken() {
|
||||
return StatisticsStorage.createSteppingToken(SteppingAction.STEP_INTO, Engine.JAVA);
|
||||
protected @NotNull SteppingAction getSteppingAction() {
|
||||
return SteppingAction.STEP_INTO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2078,8 +2077,8 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object createCommandToken() {
|
||||
return StatisticsStorage.createSteppingToken(SteppingAction.STEP_OVER, Engine.JAVA);
|
||||
protected @NotNull SteppingAction getSteppingAction() {
|
||||
return SteppingAction.STEP_OVER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2140,6 +2139,11 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NotNull SteppingAction getSteppingAction() {
|
||||
return SteppingAction.RUN_TO_CURSOR;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class StepCommand extends ResumeCommand {
|
||||
@@ -2172,8 +2176,14 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
public void step(SuspendContextImpl suspendContext, ThreadReferenceProxyImpl stepThread, RequestHint hint, Object commandToken) {
|
||||
}
|
||||
|
||||
public Object createCommandToken() {
|
||||
return null;
|
||||
protected @NotNull Engine getEngine() {
|
||||
return Engine.JAVA;
|
||||
}
|
||||
|
||||
protected abstract @NotNull SteppingAction getSteppingAction();
|
||||
|
||||
public final @NotNull Object createCommandToken() {
|
||||
return StatisticsStorage.createSteppingToken(getSteppingAction(), getEngine());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.debugger.engine
|
||||
|
||||
enum class SteppingAction {
|
||||
STEP_INTO, STEP_OUT, STEP_OVER, RUN_TO_CURSOR
|
||||
}
|
||||
@@ -4,6 +4,7 @@ package com.intellij.debugger.statistics
|
||||
import com.intellij.debugger.actions.JvmSmartStepIntoHandler
|
||||
import com.intellij.debugger.engine.DebugProcess
|
||||
import com.intellij.debugger.engine.DebugProcessEvents
|
||||
import com.intellij.debugger.engine.SteppingAction
|
||||
import com.intellij.debugger.ui.breakpoints.Breakpoint
|
||||
import com.intellij.internal.statistic.eventLog.EventLogGroup
|
||||
import com.intellij.internal.statistic.eventLog.events.EventFields
|
||||
@@ -15,7 +16,7 @@ import org.jetbrains.annotations.ApiStatus
|
||||
object DebuggerStatistics : CounterUsagesCollector() {
|
||||
override fun getGroup(): EventLogGroup = GROUP
|
||||
|
||||
private val GROUP = EventLogGroup("java.debugger", 8)
|
||||
private val GROUP = EventLogGroup("java.debugger", 9)
|
||||
|
||||
// fields
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
package com.intellij.debugger.statistics
|
||||
|
||||
import com.intellij.debugger.engine.DebugProcess
|
||||
import com.intellij.debugger.engine.SteppingAction
|
||||
import com.intellij.debugger.ui.breakpoints.Breakpoint
|
||||
import com.intellij.openapi.util.Key
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@@ -73,10 +74,6 @@ data class BreakpointInstallStatistic(val breakpoint: Breakpoint<*>) : Statistic
|
||||
*/
|
||||
class SteppingStatistic(val action: SteppingAction, val engine: Engine) : StatisticElement
|
||||
|
||||
enum class SteppingAction {
|
||||
STEP_INTO, STEP_OUT, STEP_OVER
|
||||
}
|
||||
|
||||
enum class Engine {
|
||||
JAVA, KOTLIN
|
||||
}
|
||||
|
||||
+1
-3
@@ -5,8 +5,6 @@ import com.intellij.debugger.SourcePosition
|
||||
import com.intellij.debugger.engine.*
|
||||
import com.intellij.debugger.jdi.ThreadReferenceProxyImpl
|
||||
import com.intellij.debugger.statistics.Engine
|
||||
import com.intellij.debugger.statistics.StatisticsStorage.Companion.createSteppingToken
|
||||
import com.intellij.debugger.statistics.SteppingAction
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import com.intellij.openapi.diagnostic.thisLogger
|
||||
import com.intellij.xdebugger.XSourcePosition
|
||||
@@ -84,7 +82,7 @@ object DebuggerSteppingHelper {
|
||||
return hint
|
||||
}
|
||||
|
||||
override fun createCommandToken() = createSteppingToken(SteppingAction.STEP_OVER, Engine.KOTLIN)
|
||||
override fun getEngine() = Engine.KOTLIN
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-6
@@ -5,8 +5,6 @@ import com.intellij.debugger.engine.*
|
||||
import com.intellij.debugger.engine.evaluation.EvaluateException
|
||||
import com.intellij.debugger.jdi.ThreadReferenceProxyImpl
|
||||
import com.intellij.debugger.statistics.Engine
|
||||
import com.intellij.debugger.statistics.StatisticsStorage.Companion.createSteppingToken
|
||||
import com.intellij.debugger.statistics.SteppingAction
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import com.sun.jdi.request.StepRequest
|
||||
import org.jetbrains.kotlin.idea.debugger.core.KotlinDebuggerCoreBundle.message
|
||||
@@ -57,7 +55,7 @@ object KotlinStepActionFactory {
|
||||
return hint
|
||||
}
|
||||
|
||||
override fun createCommandToken() = createSteppingToken(SteppingAction.STEP_OVER, Engine.KOTLIN)
|
||||
override fun getEngine() = Engine.KOTLIN
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,7 +82,7 @@ object KotlinStepActionFactory {
|
||||
return getThreadFilterFromContextForStepping(suspendContext) ?: super.getThreadFilterFromContext(suspendContext)
|
||||
}
|
||||
|
||||
override fun createCommandToken() = createSteppingToken(SteppingAction.STEP_INTO, Engine.KOTLIN)
|
||||
override fun getEngine() = Engine.KOTLIN
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,7 +107,7 @@ object KotlinStepActionFactory {
|
||||
return hint
|
||||
}
|
||||
|
||||
override fun createCommandToken() = createSteppingToken(SteppingAction.STEP_INTO, Engine.KOTLIN)
|
||||
override fun getEngine() = Engine.KOTLIN
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,7 +146,7 @@ object KotlinStepActionFactory {
|
||||
return getThreadFilterFromContextForStepping(suspendContext) ?: super.getThreadFilterFromContext(suspendContext)
|
||||
}
|
||||
|
||||
override fun createCommandToken() = createSteppingToken(SteppingAction.STEP_OUT, Engine.KOTLIN)
|
||||
override fun getEngine() = Engine.KOTLIN
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user