gpt4 book ai didi

visual-studio - 赋予 Intellij IDEA Visual Studio 的 F5、F10 和 F11 键功能

转载 作者:行者123 更新时间:2023-12-01 01:07:32 29 4
gpt4 key购买 nike

在 Visual Studio 中,F5 用于启动调试和在调试开始(或“继续”)后恢复程序执行。 Intellij 有单独的调试命令 (Shift+F9) 和恢复程序 F9)。

在调试器未运行时按 F9(恢复程序)会显示带有启动配置列表的上下文菜单,而在调试器运行时按 Shift+F9(开始调试)似乎会启动程序的新实例并终止旧实例(!)。我可以将 F5 映射到恢复程序并开始调试,但它的行为就像它单独映射到恢复程序一样。相反,如果调试器正在运行,我希望 F5 恢复程序,否则开始调试。

有什么方法可以根据调试器是否已经在运行来更改 Intellij 中某个键的功能,以便我可以使 F5 的行为与 Visual Studio 中的一样?

在相关说明中,如果调试器尚未运行,是否有某种方法可以让 F10 和 F11(单步执行/单步执行)在第一行开始调试,就像在 Visual Studio 中一样?

最佳答案

... while pressing Shift+F9 (start debugging) when the debugger is running appears to start a new instance of the program and kill the old instance (!)



默认情况下,在调试 session 运行时键入 Shift+F9 将在调试工具窗口的新选项卡中启动一个新实例。旧实例仍在单独的选项卡中运行。如果您在 Run/Debug 配置中选择了“Single Instance Only”选项,IDEA 会提示您是否希望停止当前实例。但是,如果您在某个时候选择了“以后不再显示此对话框”选项,那么它将默认停止并重新运行。

Is there any way to change the functionality of a key in Intellij based on whether the debugger is already running, so that I can make the F5 behave like in Visual Studio?



不直接。但是,请参阅下一个答案...

On a related note, is there some way to make F10 and F11 (Step Over/Step Into) start debugging at the first line if the debugger is not already running, also like in Visual Studio?



如果说您将 F5 映射到“调试(开始)”和“单步执行”(或其他步骤操作之一),它将在不运行时启动调试器,并在不运行时执行步骤操作。我不确定为什么这对加倍启动调试和恢复操作不起作用;它很可能与编辑器处理某些操作的方式有关。

您可能需要考虑为您想要的行为打开一个功能请求: http://youtrack.jetbrains.com

关于visual-studio - 赋予 Intellij IDEA Visual Studio 的 F5、F10 和 F11 键功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17478435/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com