vscode-maven icon indicating copy to clipboard operation
vscode-maven copied to clipboard

Do not ask to save a currently open .class file when launching in debug mode

Open Artur- opened this issue 3 years ago • 5 comments

Describe the bug If you have a .class file open when launching e.g. a Maven target in debug mode, VS Code popups up a dialog that asks you to save the current .class file which is in a JAR file.

I rarely want to save .class files

To Reproduce Steps to reproduce the behavior:

  1. Open a Maven Java project
  2. cmd-t -> e.g. #String
  3. Launch a Maven target in debug mode

Expected behavior No popup

Environments (please complete the following information as much as possible):

  • OS: [e.g. Windows 10/Linux/OS X] mac Big Sur
  • VS Code version: [e.g. 1.24.0] 1.60.2
  • Extension version [e.g. 0.9.0] 0.34.0

Screenshots image

Redirected here from https://github.com/redhat-developer/vscode-java/issues/2131

Artur- avatar Sep 27 '21 10:09 Artur-

Launch a Maven target in debug mode

Can you specify how did you "launch a maven target"? Pressing F5? or executing command from "Maven Project" explorer? or run something from terminal?

@testforstephen please take a look if it's related to debugger.

Eskibear avatar Sep 27 '21 12:09 Eskibear

Right click and "debug" on the Maven goal in the "Maven" panel in the "Explorer" tab

Artur- avatar Sep 27 '21 12:09 Artur-

this behavior is from VS Code platform. But there is a setting to allow you to customize the behavior. For example, you could disable it via the setting "debug.saveBeforeStart": "nonUntitledEditorsInActiveGroup".

testforstephen avatar Sep 27 '21 12:09 testforstephen

That setting seems to deal with the problem but it also prevents VS Code from asking to save any untitled editors before launching, as the setting says

Artur- avatar Sep 28 '21 09:09 Artur-

That setting seems to deal with the problem but it also prevents VS Code from asking to save any untitled editors before launching, as the setting says

I'm using "nonUntitledEditorsInActiveGroup" and works for me. Does it meet your needs?

testforstephen avatar Sep 28 '21 13:09 testforstephen