IDEA-207694 There should remain the possibility to invoke 'normal' stepInto action

This commit is contained in:
Egor Ushakov
2019-02-28 19:04:41 +03:00
parent 726a4654f3
commit 3c8d2be150
5 changed files with 14 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ import com.intellij.debugger.impl.DebuggerSession;
import com.intellij.debugger.impl.DebuggerUtilsEx;
import com.intellij.debugger.jdi.MethodBytecodeUtil;
import com.intellij.debugger.jdi.StackFrameProxyImpl;
import com.intellij.debugger.settings.DebuggerSettings;
import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.diagnostic.Logger;
@@ -20,7 +21,6 @@ import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
import com.intellij.util.DocumentUtil;
@@ -69,7 +69,7 @@ public class JavaSmartStepIntoHandler extends JvmSmartStepIntoHandler {
@NotNull
@Override
public Promise<List<SmartStepTarget>> findStepIntoTargets(SourcePosition position, DebuggerSession session) {
if (Registry.is("debugger.smart.step.always")) {
if (DebuggerSettings.getInstance().ALWAYS_SMART_STEP_INTO) {
return findSmartStepTargetsAsync(position, session);
}
return Promises.rejectedPromise();

View File

@@ -1,4 +1,4 @@
// Copyright 2000-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 file.
// Copyright 2000-2019 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 com.intellij.debugger.settings;
import com.intellij.debugger.impl.DebuggerUtilsEx;
@@ -67,6 +67,7 @@ public class DebuggerSettings implements Cloneable, PersistentStateComponent<Ele
public boolean HOTSWAP_IN_BACKGROUND = true;
public boolean ENABLE_MEMORY_AGENT =
ApplicationManager.getApplication().isEAP() && !ApplicationManager.getApplication().isUnitTestMode();
public boolean ALWAYS_SMART_STEP_INTO = true;
public boolean SKIP_SYNTHETIC_METHODS = true;
public boolean SKIP_CONSTRUCTORS;
public boolean SKIP_GETTERS;
@@ -164,6 +165,7 @@ public class DebuggerSettings implements Cloneable, PersistentStateComponent<Ele
ALWAYS_DEBUG == secondSettings.ALWAYS_DEBUG &&
HOTSWAP_IN_BACKGROUND == secondSettings.HOTSWAP_IN_BACKGROUND &&
ENABLE_MEMORY_AGENT == secondSettings.ENABLE_MEMORY_AGENT &&
ALWAYS_SMART_STEP_INTO == secondSettings.ALWAYS_SMART_STEP_INTO &&
SKIP_SYNTHETIC_METHODS == secondSettings.SKIP_SYNTHETIC_METHODS &&
SKIP_CLASSLOADERS == secondSettings.SKIP_CLASSLOADERS &&
SKIP_CONSTRUCTORS == secondSettings.SKIP_CONSTRUCTORS &&

View File

@@ -1,4 +1,4 @@
// Copyright 2000-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 file.
// Copyright 2000-2019 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 com.intellij.debugger.settings;
import com.intellij.debugger.DebuggerBundle;
@@ -18,6 +18,7 @@ import java.awt.event.ActionListener;
import static java.awt.GridBagConstraints.*;
class DebuggerSteppingConfigurable implements ConfigurableUi<DebuggerSettings> {
private JCheckBox myCbAlwaysSmartStep;
private JCheckBox myCbStepInfoFiltersEnabled;
private JCheckBox myCbSkipSyntheticMethods;
private JCheckBox myCbSkipConstructors;
@@ -31,6 +32,8 @@ class DebuggerSteppingConfigurable implements ConfigurableUi<DebuggerSettings> {
@Override
public void reset(@NotNull DebuggerSettings settings) {
myCbAlwaysSmartStep.setSelected(settings.ALWAYS_SMART_STEP_INTO);
myCbSkipSimpleGetters.setSelected(settings.SKIP_GETTERS);
myCbSkipSyntheticMethods.setSelected(settings.SKIP_SYNTHETIC_METHODS);
myCbSkipConstructors.setSelected(settings.SKIP_CONSTRUCTORS);
@@ -60,6 +63,7 @@ class DebuggerSteppingConfigurable implements ConfigurableUi<DebuggerSettings> {
}
private void getSettingsTo(DebuggerSettings settings) {
settings.ALWAYS_SMART_STEP_INTO = myCbAlwaysSmartStep.isSelected();
settings.SKIP_GETTERS = myCbSkipSimpleGetters.isSelected();
settings.SKIP_SYNTHETIC_METHODS = myCbSkipSyntheticMethods.isSelected();
settings.SKIP_CONSTRUCTORS = myCbSkipConstructors.isSelected();
@@ -91,12 +95,14 @@ class DebuggerSteppingConfigurable implements ConfigurableUi<DebuggerSettings> {
@NotNull
public JComponent getComponent() {
final JPanel panel = new JPanel(new GridBagLayout());
myCbAlwaysSmartStep = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.always.smart.step.into"));
myCbSkipSyntheticMethods = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.synthetic.methods"));
myCbSkipConstructors = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.constructors"));
myCbSkipClassLoaders = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.classLoaders"));
myCbSkipSimpleGetters = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.simple.getters"));
myCbStepInfoFiltersEnabled = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.step.filters.list.header"));
panel.add(myCbSkipSyntheticMethods, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0));
panel.add(myCbAlwaysSmartStep, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0));
panel.add(myCbSkipSyntheticMethods, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.insetsTop(8), 0, 0));
panel.add(myCbSkipConstructors, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0));
panel.add(myCbSkipClassLoaders, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0));
panel.add(myCbSkipSimpleGetters, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0));

View File

@@ -342,8 +342,6 @@ debugger.click.disable.breakpoints=false
debugger.click.disable.breakpoints.description=Single click to disable a breakpoint, middle click to remove
debugger.renderers.file=true
debugger.renderers.file.description=Enable file object renderer
debugger.smart.step.always=true
debugger.smart.step.always.description=Use smart step into instead of the regular one
debugger.single.smart.step.force=true
debugger.single.smart.step.force.description=Do force step into on single variant smart step into
debugger.emulate.method.breakpoints=true

View File

@@ -249,6 +249,7 @@ label.debugger.general.configurable.kill.immediately=Kill the debug process imme
label.debugger.general.configurable.always.debug=Start run configurations with the debug agent
label.debugger.general.configurable.enable.memory.agent=Attach memory agent
label.debugger.general.configurable.enable.memory.agent.tooltip.text=Java debugger will provide additional information about objects in the heap
label.debugger.general.configurable.always.smart.step.into=A&lways do smart step into
label.debugger.general.configurable.skip.synthetic.methods=Ski&p synthetic methods
label.debugger.general.configurable.skip.constructors=Skip &constructors
label.debugger.general.configurable.skip.classLoaders=Skip class l&oaders