diff --git a/README.md b/README.md index 147951ad..8e3884f9 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,10 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht - `java.debug.settings.stepping.skipConstructors`: Skip constructor methods when stepping. - `java.debug.settings.jdwp.limitOfVariablesPerJdwpRequest`: The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout. Defaults to 100. - `java.debug.settings.jdwp.requestTimeout`: The timeout (ms) of JDWP request when the debugger communicates with the target JVM. Defaults to 3000. +- `java.debug.settings.jdwp.async`: Experimental: Controls whether the debugger is allowed to send JDWP commands asynchronously. Async mode can improve remote debugging response speed on high-latency networks. Defaults to `auto`, and automatically enable async mode in VS Code - Insiders. + - `auto` (Default) + - `on` + - `off` - `java.debug.settings.vmArgs`: The default VM arguments to launch the Java program. Eg. Use '-Xmx1G -ea' to increase the heap size to 1GB and enable assertions. If you want to customize the VM arguments for a specific debug session, please modify the 'vmArgs' config in launch.json. - `java.silentNotification`: Controls whether notifications can be used to report progress. If true, use status bar to report progress instead. Defaults to `false`. diff --git a/package.json b/package.json index 9516120f..895e07b4 100644 --- a/package.json +++ b/package.json @@ -922,6 +922,16 @@ "default": 3000, "minimum": 100 }, + "java.debug.settings.jdwp.async": { + "type": "string", + "enum": [ + "auto", + "on", + "off" + ], + "description": "%java.debugger.configuration.jdwp.async.description%", + "default": "auto" + }, "java.debug.settings.vmArgs": { "type": "string", "description": "%java.debugger.configuration.vmArgs.description%", diff --git a/package.nls.json b/package.nls.json index 01884ce0..d25d1d3b 100644 --- a/package.nls.json +++ b/package.nls.json @@ -69,5 +69,6 @@ "java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description": "The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout.", "java.debugger.configuration.jdwp.requestTimeout.description": "The timeout (ms) of JDWP request when the debugger communicates with the target JVM.", "java.debugger.configuration.vmArgs.description": "The default VM arguments to launch the Java program. Eg. Use '-Xmx1G -ea' to increase the heap size to 1GB and enable assertions. If you want to customize the VM arguments for a specific debug session, please modify the 'vmArgs' config in launch.json.", - "java.debugger.configuration.silentNotification": "Controls whether notifications can be used to report progress. If true, use status bar to report progress instead." + "java.debugger.configuration.silentNotification": "Controls whether notifications can be used to report progress. If true, use status bar to report progress instead.", + "java.debugger.configuration.jdwp.async.description": "Experimental: Controls whether the debugger is allowed to send JDWP commands asynchronously. Async mode can improve remote debugging response speed on high-latency networks." } diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index 50e98b92..72d1841b 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -66,5 +66,6 @@ "java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description": "一次JDWP请求中可以请求的变量或字段的最大数量。该值越高,在展开变量视图时,请求debuggee的频率就越低。同时数量过大也会导致JDWP请求超时。", "java.debugger.configuration.jdwp.requestTimeout.description": "调试器与目标JVM通信时JDWP请求的超时时间(ms)。", "java.debugger.configuration.vmArgs.description": "启动Java程序的默认VM参数。例如,使用'-Xmx1G -ea'将堆大小增加到1GB并启用断言。如果要为特定的调试会话定制VM参数,请修改launch.json中的'vmArgs'配置。", - "java.debugger.configuration.silentNotification": "控制是否可以使用通知来报告进度。如果为真,则使用状态栏来报告进度。" + "java.debugger.configuration.silentNotification": "控制是否可以使用通知来报告进度。如果为真,则使用状态栏来报告进度。", + "java.debugger.configuration.jdwp.async.description": "实验性的:控制是否允许调试器以异步方式发送JDWP命令。异步模式可以提高高延迟网络上的远程调试响应速度。" } \ No newline at end of file diff --git a/src/configurationProvider.ts b/src/configurationProvider.ts index 0f37e94d..13c1ef62 100644 --- a/src/configurationProvider.ts +++ b/src/configurationProvider.ts @@ -737,6 +737,11 @@ async function updateDebugSettings(event?: vscode.ConfigurationChangeEvent) { const exceptionFilters = { skipClasses: await substituteFilterVariables(debugSettingsRoot.settings.exceptionBreakpoint.skipClasses), }; + + let asyncJDWP: string = debugSettingsRoot.settings.jdwp.async; + if (asyncJDWP === "auto" && vscode.env?.appName === "Visual Studio Code - Insiders") { + asyncJDWP = "on"; + } const settings = await commands.executeJavaLanguageServerCommand(commands.JAVA_UPDATE_DEBUG_SETTINGS, JSON.stringify( { ...debugSettingsRoot.settings, @@ -747,6 +752,7 @@ async function updateDebugSettings(event?: vscode.ConfigurationChangeEvent) { exceptionFiltersUpdated: event && event.affectsConfiguration("java.debug.settings.exceptionBreakpoint.skipClasses"), limitOfVariablesPerJdwpRequest: Math.max(debugSettingsRoot.settings.jdwp.limitOfVariablesPerJdwpRequest, 1), jdwpRequestTimeout: Math.max(debugSettingsRoot.settings.jdwp.requestTimeout, 100), + asyncJDWP, })); if (logLevel === "FINE") { // tslint:disable-next-line:no-console