Skip to content

Commit 4c80493

Browse files
authored
Handle unavailable sources in compliance with DAP spec (#609)
1 parent ab5d534 commit 4c80493

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/StackTraceRequestHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ private Types.StackFrame convertDebuggerStackFrameToClient(StackFrameInfo jdiFra
220220
} else {
221221
// For other unavailable method, such as lambda expression's built-in methods run/accept/apply,
222222
// display "Unknown Source" in the Call Stack View.
223-
clientSource = null;
223+
clientSource = new Types.Source("Unknown Source", "unknown", 0);
224224
}
225+
// DAP specifies lineNumber to be set to 0 when unavailable
226+
clientLineNumber = 0;
225227
} else if (DebugSettings.getCurrent().debugSupportOnDecompiledSource == Switch.ON
226228
&& clientSource != null && clientSource.path != null) {
227229
// Align the original line with the decompiled line.

0 commit comments

Comments
 (0)