diff --git a/README.md b/README.md index 4c90b8be..45d26d46 100644 --- a/README.md +++ b/README.md @@ -124,12 +124,12 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht - `java.debug.settings.showToString`: show 'toString()' value for all classes that override 'toString' method in "Variables" viewlet, defaults to `true`. - `java.debug.settings.maxStringLength`: the maximum length of string displayed in "Variables" or "Debug Console" viewlet, the string longer than this length will be trimmed, defaults to `0` which means no trim is performed. - `java.debug.settings.numericPrecision`: the precision when formatting doubles in "Variables" or "Debug Console" viewlet. -- `java.debug.settings.hotCodeReplace`: Reload the changed Java classes during debugging, defaults to `manual`. Make sure `java.autobuild.enabled` is not disabled for [VSCode Java](https://github.com/redhat-developer/vscode-java). See the [wiki page](https://github.com/Microsoft/vscode-java-debug/wiki/Hot-Code-Replace) for more information about usages and limitations. +- `java.debug.settings.hotCodeReplace`: Reload the changed Java classes during debugging, defaults to `manual`. See the [wiki page](https://github.com/Microsoft/vscode-java-debug/wiki/Hot-Code-Replace) for more information about usages and limitations. - `manual` - Click the toolbar to apply the changes. - - `auto` - Automatically apply the changes after compilation. + - `auto` - Automatically apply the changes after compilation. This only works when `'java.autobuild.enabled'` is on. - `never` - Never apply the changes. - `java.debug.settings.enableRunDebugCodeLens`: enable the code lens provider for the run and debug buttons over main entry points, defaults to `true`. -- `java.debug.settings.forceBuildBeforeLaunch`: force building the workspace before launching java program, defaults to `true`. +- `java.debug.settings.forceBuildBeforeLaunch`: force building the workspace before launching java program, defaults to `true`. If `'java.autobuild.enabled'` is disabled, this setting will be ignored and still force a build job before launching. - `java.debug.settings.onBuildFailureProceed`: Force to proceed when build fails, defaults to false. - `java.debug.settings.console`: The specified console to launch Java program, defaults to `integratedTerminal`. If you want to customize the console for a specific debug session, please modify the 'console' config in launch.json. - `internalConsole` - VS Code debug console (input stream not supported). diff --git a/package.nls.json b/package.nls.json index d25d1d3b..a227e540 100644 --- a/package.nls.json +++ b/package.nls.json @@ -60,9 +60,9 @@ "java.debugger.configuration.showToString.description": "Show 'toString()' value for all classes that override 'toString' method in \"Variables\" viewlet.", "java.debugger.configuration.maxStringLength.description": "The maximum length of strings displayed in \"Variables\" or \"Debug Console\" viewlet, strings longer than this length will be trimmed, if 0 no trim is performed.", "java.debugger.configuration.numericPrecision.description": "The precision when formatting doubles in \"Variables\" or \"Debug Console\" viewlet.", - "java.debugger.configuration.hotCodeReplace.description": "Reload the changed Java classes during debugging. Make sure 'java.autobuild.enabled' is not disabled.", + "java.debugger.configuration.hotCodeReplace.description": "Reload the changed Java classes during debugging.", "java.debugger.configuration.enableRunDebugCodeLens.description": "Enable the run and debug code lens providers over main methods.", - "java.debugger.configuration.forceBuildBeforeLaunch": "Force building the workspace before launching java program.", + "java.debugger.configuration.forceBuildBeforeLaunch": "Force building the workspace before launching java program. If 'java.autobuild.enabled' is disabled, this setting will be ignored and still force a build job before launching.", "java.debugger.configuration.onBuildFailureProceed": "Force to proceed when build fails", "java.debugger.configuration.console": "The specified console to launch Java program. If you want to customize the console for a specific debug session, please modify the 'console' config in launch.json.", "java.debugger.configuration.exceptionBreakpoint.skipClasses": "Skip the specified classes when breaking on exception. You could use the built-in variables such as '$JDK' and '$Libraries' to skip a group of classes, or add a specific class name expression, e.g. java.*, *.Foo", diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index 72d1841b..3cf24588 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -58,9 +58,9 @@ "java.debugger.configuration.showLogicalStructure.description": "在“变量”视图中显示Collection和Map类的逻辑结构。", "java.debugger.configuration.showToString.description": "在“变量”视图中显示所有重载过'toString'方法的类的'toString()'值。", "java.debugger.configuration.maxStringLength.description": "设定“变量”或“调试控制台”视图中显示的字符串最大长度,长度超过部分将被剪掉。如果值为0,则不执行修剪。", - "java.debugger.configuration.hotCodeReplace.description": "在调试期间重新加载已更改的Java类。确保未禁用'java.autobuild.enabled'。", + "java.debugger.configuration.hotCodeReplace.description": "在调试期间重新加载已更改的Java类。", "java.debugger.configuration.enableRunDebugCodeLens.description": "在main方法上启用CodeLens标记。", - "java.debugger.configuration.forceBuildBeforeLaunch": "在启动java程序之前强制编译整个工作空间。", + "java.debugger.configuration.forceBuildBeforeLaunch": "在启动java程序之前强制编译整个工作空间。如果“java.autobuild.enabled”被禁掉,则会忽略该设置,在运行之前强制执行一次编译。", "java.debugger.configuration.console": "指定的控制台用于启动Java程序。如果要为特定的调试会话自定义控制台,请修改launch.json中的“console”配置。", "java.debugger.configuration.exceptionBreakpoint.skipClasses": "当发生异常时,跳过指定的类。你可以使用内置变量,如'$JDK'和'$Libraries'来跳过一组类,或者添加一个特定的类名表达式,如java.*,*.Foo。", "java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description": "一次JDWP请求中可以请求的变量或字段的最大数量。该值越高,在展开变量视图时,请求debuggee的频率就越低。同时数量过大也会导致JDWP请求超时。", diff --git a/src/configurationProvider.ts b/src/configurationProvider.ts index a91beba6..bd5a81f3 100644 --- a/src/configurationProvider.ts +++ b/src/configurationProvider.ts @@ -769,8 +769,8 @@ async function updateDebugSettings(event?: vscode.ConfigurationChangeEvent) { } function needsBuildWorkspace(): boolean { - const debugSettingsRoot: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("java.debug.settings"); - return debugSettingsRoot ? debugSettingsRoot.forceBuildBeforeLaunch : true; + const javaConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("java"); + return !javaConfig?.autobuild?.enabled || javaConfig?.debug?.settings?.forceBuildBeforeLaunch; } function convertLogLevel(commonLogLevel: string) {