Skip to content

Commit c37f3cb

Browse files
Provide a setting to control whether to support debugging on decompiled source (#1356)
* Provide a setting to control whether to support debugging on decompiled source
1 parent 029f34e commit c37f3cb

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

Diff for: .vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
1111
"stopOnEntry": false,
1212
"sourceMaps": true,
13-
"outFiles": [ "${workspaceRoot}/out/src/**/*.js" ],
13+
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
1414
"preLaunchTask": "npm: watch",
1515
"env": {
1616
"DEBUG_VSCODE_JAVA":"true"

Diff for: package.json

+10
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,16 @@
967967
"description": "%java.debugger.configuration.vmArgs.description%",
968968
"default": ""
969969
},
970+
"java.debug.settings.debugSupportOnDecompiledSource": {
971+
"type": "string",
972+
"enum": [
973+
"auto",
974+
"on",
975+
"off"
976+
],
977+
"description": "%java.debugger.configuration.debugSupportOnDecompiledSource.description%",
978+
"default": "auto"
979+
},
970980
"java.silentNotification": {
971981
"type": "boolean",
972982
"description": "%java.debugger.configuration.silentNotification%",

Diff for: package.nls.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@
7272
"java.debugger.configuration.jdwp.requestTimeout.description": "The timeout (ms) of JDWP request when the debugger communicates with the target JVM.",
7373
"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.",
7474
"java.debugger.configuration.silentNotification": "Controls whether notifications can be used to report progress. If true, use status bar to report progress instead.",
75-
"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."
75+
"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.",
76+
"java.debugger.configuration.debugSupportOnDecompiledSource.description": "[Experimental]: Enable debugging support on the decompiled source code. When set to 'auto', this feature will be automatically enabled in Visual Studio Code - Insiders. Be aware that this feature may affect the loading speed of Call Stack Viewlet."
7677
}

Diff for: package.nls.zh-cn.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,6 @@
6969
"java.debugger.configuration.jdwp.requestTimeout.description": "调试器与目标JVM通信时JDWP请求的超时时间(ms)。",
7070
"java.debugger.configuration.vmArgs.description": "启动Java程序的默认VM参数。例如,使用'-Xmx1G -ea'将堆大小增加到1GB并启用断言。如果要为特定的调试会话定制VM参数,请修改launch.json中的'vmArgs'配置。",
7171
"java.debugger.configuration.silentNotification": "控制是否可以使用通知来报告进度。如果为真,则使用状态栏来报告进度。",
72-
"java.debugger.configuration.jdwp.async.description": "实验性的:控制是否允许调试器以异步方式发送JDWP命令。异步模式可以提高高延迟网络上的远程调试响应速度。"
72+
"java.debugger.configuration.jdwp.async.description": "实验性的:控制是否允许调试器以异步方式发送JDWP命令。异步模式可以提高高延迟网络上的远程调试响应速度。",
73+
"java.debugger.configuration.debugSupportOnDecompiledSource.description": "[实验性的]: 在反编译的源代码上启用调试支持。当设置为'auto'时,该功能将在Visual Studio Code - Insiders中自动启用。请注意,该功能可能会影响Call Stack试图的加载速度。"
7374
}

Diff for: src/configurationProvider.ts

+5
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,10 @@ async function updateDebugSettings(event?: vscode.ConfigurationChangeEvent) {
785785
};
786786

787787
const asyncJDWP: string = debugSettingsRoot.settings.jdwp.async;
788+
let debugSupportOnDecompiledSource: string = debugSettingsRoot.settings.debugSupportOnDecompiledSource;
789+
if (debugSupportOnDecompiledSource === 'auto') {
790+
debugSupportOnDecompiledSource = vscode.version.includes("insider") ? "on" : "off";
791+
}
788792
const settings = await commands.executeJavaLanguageServerCommand(commands.JAVA_UPDATE_DEBUG_SETTINGS, JSON.stringify(
789793
{
790794
...debugSettingsRoot.settings,
@@ -799,6 +803,7 @@ async function updateDebugSettings(event?: vscode.ConfigurationChangeEvent) {
799803
limitOfVariablesPerJdwpRequest: Math.max(debugSettingsRoot.settings.jdwp.limitOfVariablesPerJdwpRequest, 1),
800804
jdwpRequestTimeout: Math.max(debugSettingsRoot.settings.jdwp.requestTimeout, 100),
801805
asyncJDWP,
806+
debugSupportOnDecompiledSource,
802807
}));
803808
if (logLevel === "FINE") {
804809
// tslint:disable-next-line:no-console

0 commit comments

Comments
 (0)