vscode-java-debug
vscode-java-debug copied to clipboard
Disabling or editing the Run Java/Debug Java options
Hi. Is it possible to remove or override the "Run Java", "Debug Java" buttons that (I believe) the Java Debugger extension is adding to VSCode? I'm running a Gradle project and the Gradle extension can successfully run and debug the project but I don't think it's possible to edit the launch.json file to use the same calls that the Gradle extension uses.
It's not a big deal but it's just confusing to have very visible Run/Debug buttons that do not work but have a set of Run/Debug buttons inside the Gradle extension that do work (but depend on the Java Debugger extension also so I can't totally disable it).
Thanks.
Environment
- Operating System: Mac
- JDK version: 17
- Visual Studio Code version: 1.7.3.1
- Java extension version: 0.25.6
- Java Debugger extension version: 0.46.0
Since the Run/Debug button will work in most cases, the question is when does the Java debugger know to disable itself?
If a build tool like Maven or Gradle always handles run/debug well, then delegating the run/debug button to the build tool's run task might be fine.
Add @CsCherrYY @Eskibear for more thoughts.
It's OK for Gradle extension to provide the way to run a runnable task (task name, corresponding main class information if possible, run request handler, or so on). And I'm wondering when we should delegate the run behaviors to build tools in the Java debugger. Should we just replace the run button content with build tool information if it exists (delegate run to build tool completely)? Or is there any limitation?
I assume @lucianthorr 's expectation would be something like IDEA/Eclipse's "Run" button in toolbar, listing all launch configs that you can explicit choose one. However, VSCode doesn't have a pinned toolbar and it puts all that in the Debug view.
then delegating the run/debug button to the build tool's run task might be fine.
Java debugger extension registers these buttons for .java file, and you don't know whether the java file belongs to a maven or gradle project, or both. And for the moment I don't think Java debugger extension should provide such "general" run/debug button and implement the logic to delegate... It's more like vscode's job instead of a language extension
I was mostly just thinking that there are situations where a workspace may require the Java Debugger Extension but not need the Run/Debug buttons because they don't actually work with the project. In my case, the Gradle extension depends on Java Debugger but provides its own Run/Debug buttons for the workspace.
In this case, it'd be nice even have a Java Debugger Extension setting to hide the Run/Debug buttons since the extension is required but the buttons aren't. (These are to be taken as minor suggestions too. It's awesome to have everything working in VSCode and thanks for the response)