Skip to content

Commit c0ed20c

Browse files
Need to build workspace before launch if autobuild is disabled (#1302)
1 parent 39a84b3 commit c0ed20c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht
124124
- `java.debug.settings.showToString`: show 'toString()' value for all classes that override 'toString' method in "Variables" viewlet, defaults to `true`.
125125
- `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.
126126
- `java.debug.settings.numericPrecision`: the precision when formatting doubles in "Variables" or "Debug Console" viewlet.
127-
- `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.
127+
- `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.
128128
- `manual` - Click the toolbar to apply the changes.
129-
- `auto` - Automatically apply the changes after compilation.
129+
- `auto` - Automatically apply the changes after compilation. This only works when `'java.autobuild.enabled'` is on.
130130
- `never` - Never apply the changes.
131131
- `java.debug.settings.enableRunDebugCodeLens`: enable the code lens provider for the run and debug buttons over main entry points, defaults to `true`.
132-
- `java.debug.settings.forceBuildBeforeLaunch`: force building the workspace before launching java program, defaults to `true`.
132+
- `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.
133133
- `java.debug.settings.onBuildFailureProceed`: Force to proceed when build fails, defaults to false.
134134
- `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.
135135
- `internalConsole` - VS Code debug console (input stream not supported).

package.nls.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
"java.debugger.configuration.showToString.description": "Show 'toString()' value for all classes that override 'toString' method in \"Variables\" viewlet.",
6161
"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.",
6262
"java.debugger.configuration.numericPrecision.description": "The precision when formatting doubles in \"Variables\" or \"Debug Console\" viewlet.",
63-
"java.debugger.configuration.hotCodeReplace.description": "Reload the changed Java classes during debugging. Make sure 'java.autobuild.enabled' is not disabled.",
63+
"java.debugger.configuration.hotCodeReplace.description": "Reload the changed Java classes during debugging.",
6464
"java.debugger.configuration.enableRunDebugCodeLens.description": "Enable the run and debug code lens providers over main methods.",
65-
"java.debugger.configuration.forceBuildBeforeLaunch": "Force building the workspace before launching java program.",
65+
"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.",
6666
"java.debugger.configuration.onBuildFailureProceed": "Force to proceed when build fails",
6767
"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.",
6868
"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",

package.nls.zh-cn.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
"java.debugger.configuration.showLogicalStructure.description": "在“变量”视图中显示Collection和Map类的逻辑结构。",
5959
"java.debugger.configuration.showToString.description": "在“变量”视图中显示所有重载过'toString'方法的类的'toString()'值。",
6060
"java.debugger.configuration.maxStringLength.description": "设定“变量”或“调试控制台”视图中显示的字符串最大长度,长度超过部分将被剪掉。如果值为0,则不执行修剪。",
61-
"java.debugger.configuration.hotCodeReplace.description": "在调试期间重新加载已更改的Java类。确保未禁用'java.autobuild.enabled'。",
61+
"java.debugger.configuration.hotCodeReplace.description": "在调试期间重新加载已更改的Java类。",
6262
"java.debugger.configuration.enableRunDebugCodeLens.description": "在main方法上启用CodeLens标记。",
63-
"java.debugger.configuration.forceBuildBeforeLaunch": "在启动java程序之前强制编译整个工作空间。",
63+
"java.debugger.configuration.forceBuildBeforeLaunch": "在启动java程序之前强制编译整个工作空间。如果“java.autobuild.enabled”被禁掉,则会忽略该设置,在运行之前强制执行一次编译。",
6464
"java.debugger.configuration.console": "指定的控制台用于启动Java程序。如果要为特定的调试会话自定义控制台,请修改launch.json中的“console”配置。",
6565
"java.debugger.configuration.exceptionBreakpoint.skipClasses": "当发生异常时,跳过指定的类。你可以使用内置变量,如'$JDK'和'$Libraries'来跳过一组类,或者添加一个特定的类名表达式,如java.*,*.Foo。",
6666
"java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description": "一次JDWP请求中可以请求的变量或字段的最大数量。该值越高,在展开变量视图时,请求debuggee的频率就越低。同时数量过大也会导致JDWP请求超时。",

src/configurationProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,8 @@ async function updateDebugSettings(event?: vscode.ConfigurationChangeEvent) {
769769
}
770770

771771
function needsBuildWorkspace(): boolean {
772-
const debugSettingsRoot: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("java.debug.settings");
773-
return debugSettingsRoot ? debugSettingsRoot.forceBuildBeforeLaunch : true;
772+
const javaConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("java");
773+
return !javaConfig?.autobuild?.enabled || javaConfig?.debug?.settings?.forceBuildBeforeLaunch;
774774
}
775775

776776
function convertLogLevel(commonLogLevel: string) {

0 commit comments

Comments
 (0)