How to force IntelliJ to only step into my source code?

后端 未结 5 1975
野性不改
野性不改 2021-01-30 08:05

I have a Spring MVC project that I\'m trying to debug using IntelliJ.

If I set a breakpoint in my Controller code, the debug stops at the appropriate place. That particu

相关标签:
5条回答
  • 2021-01-30 08:39

    Currently there is no overall option to only target user code (like Visual Studio's 'Just My Code').

    The best way to have the same behavior is to exclude specific code classes or packages (it is possible to setup filter patterns for class packages via wildcards) that will not be 'stepped into'.

    This can be achieved within the Settings/Preferences, in the Debugger/Stepping options.

    0 讨论(0)
  • 2021-01-30 08:40

    Another way in "Ultimate 2019.1" (may be also in previous versions):

    When you're right now debugging you can make a right mouse click on a class in the view "Debugger" - "Frames". Then you can select "Add stepping filter..." and adding for that class a new step filter. Of course you can here also change the new step filter, using place holder "*" and so on ...

    0 讨论(0)
  • 2021-01-30 08:51

    IntelliJ ULTIMATE 2018.3 Using File -> Settings -> search 'Step' as follow:

    0 讨论(0)
  • 2021-01-30 08:54

    After the changes mentioned above, stop your application and restart into debug mode again to take effect.

    0 讨论(0)
  • 2021-01-30 08:58

    Spring's AOP may be among the worst offenders.

    The OP suggested that they had already done this, but here's how you can disable stepping into specified classes (IntelliJ ULTIMATE 2018.2):

    File -> Settings... -> Build, Execution, Deployment -> Debugger -> Stepping

    ... Do not step into the classes -> Add Pattern -> Enter the filter pattern:

    ... ... org.springframework.aop.*

    Notice that you can use wildcards to disable entire namespaces -- so for example, assuming that your organization's namespace starts with com, you can get most of the way there by blacklisting org.*.

    0 讨论(0)
提交回复
热议问题